# coding: utf-8

"""
    Pdf4me

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from pdf4me.model.rectangle import Rectangle  # noqa: F401,E501
from pdf4me.model.rotate_config import RotateConfig  # noqa: F401,E501
from pdf4me.model.transform import Transform  # noqa: F401,E501
from pdf4me.model.translate import Translate  # noqa: F401,E501


class Image(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 = {
        'rectangle': 'Rectangle',
        'image_data': 'str',
        'image_type': 'str',
        'file_name': 'str',
        'compression': 'str',
        'rotate': 'RotateConfig',
        'translate': 'Translate',
        'transform': 'Transform'
    }

    attribute_map = {
        'rectangle': 'rectangle',
        'image_data': 'imageData',
        'image_type': 'imageType',
        'file_name': 'fileName',
        'compression': 'compression',
        'rotate': 'rotate',
        'translate': 'translate',
        'transform': 'transform'
    }

    def __init__(self, rectangle=None, image_data=None, image_type=None, file_name=None, compression=None, rotate=None, translate=None, transform=None):  # noqa: E501
        """Image - a model defined in Swagger"""  # noqa: E501

        self._rectangle = None
        self._image_data = None
        self._image_type = None
        self._file_name = None
        self._compression = None
        self._rotate = None
        self._translate = None
        self._transform = None
        self.discriminator = None

        if rectangle is not None:
            self.rectangle = rectangle
        if image_data is not None:
            self.image_data = image_data
        if image_type is not None:
            self.image_type = image_type
        if file_name is not None:
            self.file_name = file_name
        if compression is not None:
            self.compression = compression
        if rotate is not None:
            self.rotate = rotate
        if translate is not None:
            self.translate = translate
        if transform is not None:
            self.transform = transform

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


        :return: The rectangle of this Image.  # noqa: E501
        :rtype: Rectangle
        """
        return self._rectangle

    @rectangle.setter
    def rectangle(self, rectangle):
        """Sets the rectangle of this Image.


        :param rectangle: The rectangle of this Image.  # noqa: E501
        :type: Rectangle
        """

        self._rectangle = rectangle

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


        :return: The image_data of this Image.  # noqa: E501
        :rtype: str
        """
        return self._image_data

    @image_data.setter
    def image_data(self, image_data):
        """Sets the image_data of this Image.


        :param image_data: The image_data of this Image.  # noqa: E501
        :type: str
        """
        if image_data is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', image_data):  # noqa: E501
            raise ValueError(r"Invalid value for `image_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._image_data = image_data

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


        :return: The image_type of this Image.  # noqa: E501
        :rtype: str
        """
        return self._image_type

    @image_type.setter
    def image_type(self, image_type):
        """Sets the image_type of this Image.


        :param image_type: The image_type of this Image.  # noqa: E501
        :type: str
        """

        self._image_type = image_type

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


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

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


        :param file_name: The file_name of this Image.  # noqa: E501
        :type: str
        """

        self._file_name = file_name

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


        :return: The compression of this Image.  # noqa: E501
        :rtype: str
        """
        return self._compression

    @compression.setter
    def compression(self, compression):
        """Sets the compression of this Image.


        :param compression: The compression of this Image.  # noqa: E501
        :type: str
        """
        allowed_values = ["cCITTFax", "flate", "dCT"]  # noqa: E501
        if compression not in allowed_values:
            raise ValueError(
                "Invalid value for `compression` ({0}), must be one of {1}"  # noqa: E501
                .format(compression, allowed_values)
            )

        self._compression = compression

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


        :return: The rotate of this Image.  # noqa: E501
        :rtype: RotateConfig
        """
        return self._rotate

    @rotate.setter
    def rotate(self, rotate):
        """Sets the rotate of this Image.


        :param rotate: The rotate of this Image.  # noqa: E501
        :type: RotateConfig
        """

        self._rotate = rotate

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


        :return: The translate of this Image.  # noqa: E501
        :rtype: Translate
        """
        return self._translate

    @translate.setter
    def translate(self, translate):
        """Sets the translate of this Image.


        :param translate: The translate of this Image.  # noqa: E501
        :type: Translate
        """

        self._translate = translate

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


        :return: The transform of this Image.  # noqa: E501
        :rtype: Transform
        """
        return self._transform

    @transform.setter
    def transform(self, transform):
        """Sets the transform of this Image.


        :param transform: The transform of this Image.  # noqa: E501
        :type: Transform
        """

        self._transform = transform

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

        return self.__dict__ == other.__dict__

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