# coding: utf-8

"""
    Creditas OpenAPI

    This is specification of the Creditas OpenAPI. It contains definitions of Creditas banking services exposed via API accessible on the internet.  # noqa: E501

    OpenAPI spec version: 1.0.0
    Contact: is@creditas.cz
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from creditas.configuration import Configuration


class Body21(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 = {
        'account_id': 'str',
        'format': 'str',
        'type': 'str',
        'import_mode': 'str',
        'reference': 'str',
        'file_name': 'str',
        'data': 'str'
    }

    attribute_map = {
        'account_id': 'accountId',
        'format': 'format',
        'type': 'type',
        'import_mode': 'importMode',
        'reference': 'reference',
        'file_name': 'fileName',
        'data': 'data'
    }

    def __init__(self, account_id=None, format=None, type=None, import_mode=None, reference=None, file_name=None, data=None, _configuration=None):  # noqa: E501
        """Body21 - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._account_id = None
        self._format = None
        self._type = None
        self._import_mode = None
        self._reference = None
        self._file_name = None
        self._data = None
        self.discriminator = None

        self.account_id = account_id
        self.format = format
        self.type = type
        self.import_mode = import_mode
        self.reference = reference
        if file_name is not None:
            self.file_name = file_name
        self.data = data

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

        The unique account identifier of the source account  # noqa: E501

        :return: The account_id of this Body21.  # noqa: E501
        :rtype: str
        """
        return self._account_id

    @account_id.setter
    def account_id(self, account_id):
        """Sets the account_id of this Body21.

        The unique account identifier of the source account  # noqa: E501

        :param account_id: The account_id of this Body21.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and account_id is None:
            raise ValueError("Invalid value for `account_id`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                account_id is not None and len(account_id) > 40):
            raise ValueError("Invalid value for `account_id`, length must be less than or equal to `40`")  # noqa: E501

        self._account_id = account_id

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

        The import format (KPC and CSV for domestic, XML and MT101 for foreign)  # noqa: E501

        :return: The format of this Body21.  # noqa: E501
        :rtype: str
        """
        return self._format

    @format.setter
    def format(self, format):
        """Sets the format of this Body21.

        The import format (KPC and CSV for domestic, XML and MT101 for foreign)  # noqa: E501

        :param format: The format of this Body21.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and format is None:
            raise ValueError("Invalid value for `format`, must not be `None`")  # noqa: E501
        allowed_values = ["CSV", "KPC", "XML", "MT101"]  # noqa: E501
        if (self._configuration.client_side_validation and
                format not in allowed_values):
            raise ValueError(
                "Invalid value for `format` ({0}), must be one of {1}"  # noqa: E501
                .format(format, allowed_values)
            )

        self._format = format

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

        The type of payments included in import data  # noqa: E501

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

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

        The type of payments included in import data  # noqa: E501

        :param type: The type of this Body21.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and type is None:
            raise ValueError("Invalid value for `type`, must not be `None`")  # noqa: E501
        allowed_values = ["DOMESTIC", "FOREIGN"]  # noqa: E501
        if (self._configuration.client_side_validation and
                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 import_mode(self):
        """Gets the import_mode of this Body21.  # noqa: E501

        Defines what happens to import data if error occurs  # noqa: E501

        :return: The import_mode of this Body21.  # noqa: E501
        :rtype: str
        """
        return self._import_mode

    @import_mode.setter
    def import_mode(self, import_mode):
        """Sets the import_mode of this Body21.

        Defines what happens to import data if error occurs  # noqa: E501

        :param import_mode: The import_mode of this Body21.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and import_mode is None:
            raise ValueError("Invalid value for `import_mode`, must not be `None`")  # noqa: E501
        allowed_values = ["CANCEL_ON_ERROR", "ALLOW_ERRORS"]  # noqa: E501
        if (self._configuration.client_side_validation and
                import_mode not in allowed_values):
            raise ValueError(
                "Invalid value for `import_mode` ({0}), must be one of {1}"  # noqa: E501
                .format(import_mode, allowed_values)
            )

        self._import_mode = import_mode

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

        The import user defined name/id  # noqa: E501

        :return: The reference of this Body21.  # noqa: E501
        :rtype: str
        """
        return self._reference

    @reference.setter
    def reference(self, reference):
        """Sets the reference of this Body21.

        The import user defined name/id  # noqa: E501

        :param reference: The reference of this Body21.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and reference is None:
            raise ValueError("Invalid value for `reference`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                reference is not None and len(reference) > 40):
            raise ValueError("Invalid value for `reference`, length must be less than or equal to `40`")  # noqa: E501

        self._reference = reference

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

        The import data file name  # noqa: E501

        :return: The file_name of this Body21.  # noqa: E501
        :rtype: str
        """
        return self._file_name

    @file_name.setter
    def file_name(self, file_name):
        """Sets the file_name of this Body21.

        The import data file name  # noqa: E501

        :param file_name: The file_name of this Body21.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                file_name is not None and len(file_name) > 255):
            raise ValueError("Invalid value for `file_name`, length must be less than or equal to `255`")  # noqa: E501

        self._file_name = file_name

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

        The import data  # noqa: E501

        :return: The data of this Body21.  # noqa: E501
        :rtype: str
        """
        return self._data

    @data.setter
    def data(self, data):
        """Sets the data of this Body21.

        The import data  # noqa: E501

        :param data: The data of this Body21.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and data is None:
            raise ValueError("Invalid value for `data`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                data is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', data)):  # noqa: E501
            raise ValueError(r"Invalid value for `data`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`")  # noqa: E501

        self._data = data

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

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