# coding: utf-8

"""
    Generated by: https://openapi-generator.tech
"""

import pprint
import re  # noqa: F401

import six

from regula.documentreader.webclient.gen.configuration import Configuration
# this line was added to enable pycharm type hinting
from regula.documentreader.webclient.gen.models import *


class ProcessParams(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 = {
        'scenario': 'Scenario',
        'result_type_output': 'list[Result]',
        'double_page_spread': 'bool',
        'field_types_filter': 'list[TextFieldType]',
        'date_format': 'str',
        'image_dpi_out_max': 'int',
        'already_cropped': 'bool',
        'custom_params': 'dict(str, object)',
        'log': 'bool',
        'force_doc_id': 'int',
        'match_text_field_mask': 'bool',
        'fast_doc_detect': 'bool',
        'update_ocr_validity_by_glare': 'bool',
        'generate_double_page_spread_image': 'bool',
        'check_required_text_fields': 'bool',
        'image_qa': 'ImageQA'
    }

    attribute_map = {
        'scenario': 'scenario',
        'result_type_output': 'resultTypeOutput',
        'double_page_spread': 'doublePageSpread',
        'field_types_filter': 'fieldTypesFilter',
        'date_format': 'dateFormat',
        'image_dpi_out_max': 'imageDpiOutMax',
        'already_cropped': 'alreadyCropped',
        'custom_params': 'customParams',
        'log': 'log',
        'force_doc_id': 'forceDocID',
        'match_text_field_mask': 'matchTextFieldMask',
        'fast_doc_detect': 'fastDocDetect',
        'update_ocr_validity_by_glare': 'updateOCRValidityByGlare',
        'generate_double_page_spread_image': 'generateDoublePageSpreadImage',
        'check_required_text_fields': 'checkRequiredTextFields',
        'image_qa': 'imageQA'
    }

    def __init__(self, scenario=None, result_type_output=None, double_page_spread=None, field_types_filter=None, date_format=None, image_dpi_out_max=None, already_cropped=None, custom_params=None, log=None, force_doc_id=None, match_text_field_mask=True, fast_doc_detect=True, update_ocr_validity_by_glare=False, generate_double_page_spread_image=None, check_required_text_fields=False, image_qa=None, local_vars_configuration=None):  # noqa: E501
        """ProcessParams - 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._scenario = None
        self._result_type_output = None
        self._double_page_spread = None
        self._field_types_filter = None
        self._date_format = None
        self._image_dpi_out_max = None
        self._already_cropped = None
        self._custom_params = None
        self._log = None
        self._force_doc_id = None
        self._match_text_field_mask = None
        self._fast_doc_detect = None
        self._update_ocr_validity_by_glare = None
        self._generate_double_page_spread_image = None
        self._check_required_text_fields = None
        self._image_qa = None
        self.discriminator = None

        self.scenario = scenario
        if result_type_output is not None:
            self.result_type_output = result_type_output
        if double_page_spread is not None:
            self.double_page_spread = double_page_spread
        if field_types_filter is not None:
            self.field_types_filter = field_types_filter
        if date_format is not None:
            self.date_format = date_format
        if image_dpi_out_max is not None:
            self.image_dpi_out_max = image_dpi_out_max
        if already_cropped is not None:
            self.already_cropped = already_cropped
        if custom_params is not None:
            self.custom_params = custom_params
        if log is not None:
            self.log = log
        if force_doc_id is not None:
            self.force_doc_id = force_doc_id
        if match_text_field_mask is not None:
            self.match_text_field_mask = match_text_field_mask
        if fast_doc_detect is not None:
            self.fast_doc_detect = fast_doc_detect
        if update_ocr_validity_by_glare is not None:
            self.update_ocr_validity_by_glare = update_ocr_validity_by_glare
        if generate_double_page_spread_image is not None:
            self.generate_double_page_spread_image = generate_double_page_spread_image
        if check_required_text_fields is not None:
            self.check_required_text_fields = check_required_text_fields
        if image_qa is not None:
            self.image_qa = image_qa

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


        :return: The scenario of this ProcessParams.  # noqa: E501
        :rtype: Scenario
        """
        return self._scenario

    @scenario.setter
    def scenario(self, scenario):
        """Sets the scenario of this ProcessParams.


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

        self._scenario = scenario

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

        Types of results to return in response. See 'Result' enum for available options  # noqa: E501

        :return: The result_type_output of this ProcessParams.  # noqa: E501
        :rtype: list[Result]
        """
        return self._result_type_output

    @result_type_output.setter
    def result_type_output(self, result_type_output):
        """Sets the result_type_output of this ProcessParams.

        Types of results to return in response. See 'Result' enum for available options  # noqa: E501

        :param result_type_output: The result_type_output of this ProcessParams.  # noqa: E501
        :type result_type_output: list[Result]
        """

        self._result_type_output = result_type_output

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

        This option can be set to true if the image you provide contains double page spread of the passport and you want to process both pages in one go. It makes sense to use it for documents that have meaningful information on both pages, like Russian domestic passport, or some others. By default is set to false.  # noqa: E501

        :return: The double_page_spread of this ProcessParams.  # noqa: E501
        :rtype: bool
        """
        return self._double_page_spread

    @double_page_spread.setter
    def double_page_spread(self, double_page_spread):
        """Sets the double_page_spread of this ProcessParams.

        This option can be set to true if the image you provide contains double page spread of the passport and you want to process both pages in one go. It makes sense to use it for documents that have meaningful information on both pages, like Russian domestic passport, or some others. By default is set to false.  # noqa: E501

        :param double_page_spread: The double_page_spread of this ProcessParams.  # noqa: E501
        :type double_page_spread: bool
        """

        self._double_page_spread = double_page_spread

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

        List of text field types to extract. If empty, all text fields from template will be extracted. Narrowing the list can shorten processing time. By default is empty.  # noqa: E501

        :return: The field_types_filter of this ProcessParams.  # noqa: E501
        :rtype: list[TextFieldType]
        """
        return self._field_types_filter

    @field_types_filter.setter
    def field_types_filter(self, field_types_filter):
        """Sets the field_types_filter of this ProcessParams.

        List of text field types to extract. If empty, all text fields from template will be extracted. Narrowing the list can shorten processing time. By default is empty.  # noqa: E501

        :param field_types_filter: The field_types_filter of this ProcessParams.  # noqa: E501
        :type field_types_filter: list[TextFieldType]
        """

        self._field_types_filter = field_types_filter

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

        This option allows you to set dates format so that solution will return dates in this format. For example, if you supply 'MM/dd/yyyy', and document have printed date '09 JUL 2020' for the date os issue, you will get '07/09/2020' as a result. By default it is set to system locale default (where the service is running).  # noqa: E501

        :return: The date_format of this ProcessParams.  # noqa: E501
        :rtype: str
        """
        return self._date_format

    @date_format.setter
    def date_format(self, date_format):
        """Sets the date_format of this ProcessParams.

        This option allows you to set dates format so that solution will return dates in this format. For example, if you supply 'MM/dd/yyyy', and document have printed date '09 JUL 2020' for the date os issue, you will get '07/09/2020' as a result. By default it is set to system locale default (where the service is running).  # noqa: E501

        :param date_format: The date_format of this ProcessParams.  # noqa: E501
        :type date_format: str
        """

        self._date_format = date_format

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

        This option controls maximum resolution in dpi of output images. Resolution will remain original in case 0 is supplied. By default is set to return images in response with resolution not greater than 300 dpi.  # noqa: E501

        :return: The image_dpi_out_max of this ProcessParams.  # noqa: E501
        :rtype: int
        """
        return self._image_dpi_out_max

    @image_dpi_out_max.setter
    def image_dpi_out_max(self, image_dpi_out_max):
        """Sets the image_dpi_out_max of this ProcessParams.

        This option controls maximum resolution in dpi of output images. Resolution will remain original in case 0 is supplied. By default is set to return images in response with resolution not greater than 300 dpi.  # noqa: E501

        :param image_dpi_out_max: The image_dpi_out_max of this ProcessParams.  # noqa: E501
        :type image_dpi_out_max: int
        """

        self._image_dpi_out_max = image_dpi_out_max

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

        This option can be set to true if you know for sure that the image you provide contains already cropped document by its edges. This was designed to process on the server side images captured and cropped on mobile. By default is set to false.  # noqa: E501

        :return: The already_cropped of this ProcessParams.  # noqa: E501
        :rtype: bool
        """
        return self._already_cropped

    @already_cropped.setter
    def already_cropped(self, already_cropped):
        """Sets the already_cropped of this ProcessParams.

        This option can be set to true if you know for sure that the image you provide contains already cropped document by its edges. This was designed to process on the server side images captured and cropped on mobile. By default is set to false.  # noqa: E501

        :param already_cropped: The already_cropped of this ProcessParams.  # noqa: E501
        :type already_cropped: bool
        """

        self._already_cropped = already_cropped

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

        This option allows to pass custom processing parameters that can be implemented in future without changing API.  # noqa: E501

        :return: The custom_params of this ProcessParams.  # noqa: E501
        :rtype: dict(str, object)
        """
        return self._custom_params

    @custom_params.setter
    def custom_params(self, custom_params):
        """Sets the custom_params of this ProcessParams.

        This option allows to pass custom processing parameters that can be implemented in future without changing API.  # noqa: E501

        :param custom_params: The custom_params of this ProcessParams.  # noqa: E501
        :type custom_params: dict(str, object)
        """

        self._custom_params = custom_params

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

        This option can be set to true if you need to get base64 string of transaction processing log.  # noqa: E501

        :return: The log of this ProcessParams.  # noqa: E501
        :rtype: bool
        """
        return self._log

    @log.setter
    def log(self, log):
        """Sets the log of this ProcessParams.

        This option can be set to true if you need to get base64 string of transaction processing log.  # noqa: E501

        :param log: The log of this ProcessParams.  # noqa: E501
        :type log: bool
        """

        self._log = log

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

        Force use of specific template ID and skip document type identification step.  # noqa: E501

        :return: The force_doc_id of this ProcessParams.  # noqa: E501
        :rtype: int
        """
        return self._force_doc_id

    @force_doc_id.setter
    def force_doc_id(self, force_doc_id):
        """Sets the force_doc_id of this ProcessParams.

        Force use of specific template ID and skip document type identification step.  # noqa: E501

        :param force_doc_id: The force_doc_id of this ProcessParams.  # noqa: E501
        :type force_doc_id: int
        """

        self._force_doc_id = force_doc_id

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

        When disabled, text field OCR will be done as is and then the recognized value will be matched to the field mask for validity. If enabled, we are trying to read a field value with maximum efforts to match the mask and provide a correctly formatted value, making assumptions based on the provided field mask in the template.  # noqa: E501

        :return: The match_text_field_mask of this ProcessParams.  # noqa: E501
        :rtype: bool
        """
        return self._match_text_field_mask

    @match_text_field_mask.setter
    def match_text_field_mask(self, match_text_field_mask):
        """Sets the match_text_field_mask of this ProcessParams.

        When disabled, text field OCR will be done as is and then the recognized value will be matched to the field mask for validity. If enabled, we are trying to read a field value with maximum efforts to match the mask and provide a correctly formatted value, making assumptions based on the provided field mask in the template.  # noqa: E501

        :param match_text_field_mask: The match_text_field_mask of this ProcessParams.  # noqa: E501
        :type match_text_field_mask: bool
        """

        self._match_text_field_mask = match_text_field_mask

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

        When enabled, shorten the list of candidates to process during document detection in a single image process mode. Reduces processing time for specific backgrounds.  # noqa: E501

        :return: The fast_doc_detect of this ProcessParams.  # noqa: E501
        :rtype: bool
        """
        return self._fast_doc_detect

    @fast_doc_detect.setter
    def fast_doc_detect(self, fast_doc_detect):
        """Sets the fast_doc_detect of this ProcessParams.

        When enabled, shorten the list of candidates to process during document detection in a single image process mode. Reduces processing time for specific backgrounds.  # noqa: E501

        :param fast_doc_detect: The fast_doc_detect of this ProcessParams.  # noqa: E501
        :type fast_doc_detect: bool
        """

        self._fast_doc_detect = fast_doc_detect

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

        When enabled, fail OCR field validity, if there is a glare over the text field on the image.  # noqa: E501

        :return: The update_ocr_validity_by_glare of this ProcessParams.  # noqa: E501
        :rtype: bool
        """
        return self._update_ocr_validity_by_glare

    @update_ocr_validity_by_glare.setter
    def update_ocr_validity_by_glare(self, update_ocr_validity_by_glare):
        """Sets the update_ocr_validity_by_glare of this ProcessParams.

        When enabled, fail OCR field validity, if there is a glare over the text field on the image.  # noqa: E501

        :param update_ocr_validity_by_glare: The update_ocr_validity_by_glare of this ProcessParams.  # noqa: E501
        :type update_ocr_validity_by_glare: bool
        """

        self._update_ocr_validity_by_glare = update_ocr_validity_by_glare

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

        When enabled together with \"doublePageSpread\" and there is a passport with two pages spread in the image, pages will be cropped, straightened and aligned together, as if the document was captured on a flatbed scanner.  # noqa: E501

        :return: The generate_double_page_spread_image of this ProcessParams.  # noqa: E501
        :rtype: bool
        """
        return self._generate_double_page_spread_image

    @generate_double_page_spread_image.setter
    def generate_double_page_spread_image(self, generate_double_page_spread_image):
        """Sets the generate_double_page_spread_image of this ProcessParams.

        When enabled together with \"doublePageSpread\" and there is a passport with two pages spread in the image, pages will be cropped, straightened and aligned together, as if the document was captured on a flatbed scanner.  # noqa: E501

        :param generate_double_page_spread_image: The generate_double_page_spread_image of this ProcessParams.  # noqa: E501
        :type generate_double_page_spread_image: bool
        """

        self._generate_double_page_spread_image = generate_double_page_spread_image

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

        When enabled, each field in template will be checked for value presence and if the field is marked as required, but has no value, it will have \"error\" in validity status.  # noqa: E501

        :return: The check_required_text_fields of this ProcessParams.  # noqa: E501
        :rtype: bool
        """
        return self._check_required_text_fields

    @check_required_text_fields.setter
    def check_required_text_fields(self, check_required_text_fields):
        """Sets the check_required_text_fields of this ProcessParams.

        When enabled, each field in template will be checked for value presence and if the field is marked as required, but has no value, it will have \"error\" in validity status.  # noqa: E501

        :param check_required_text_fields: The check_required_text_fields of this ProcessParams.  # noqa: E501
        :type check_required_text_fields: bool
        """

        self._check_required_text_fields = check_required_text_fields

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


        :return: The image_qa of this ProcessParams.  # noqa: E501
        :rtype: ImageQA
        """
        return self._image_qa

    @image_qa.setter
    def image_qa(self, image_qa):
        """Sets the image_qa of this ProcessParams.


        :param image_qa: The image_qa of this ProcessParams.  # noqa: E501
        :type image_qa: ImageQA
        """

        self._image_qa = image_qa

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

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