# 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.color import Color  # 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 Text(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 = {
        'format': 'bool',
        'size': 'int',
        'font': 'str',
        'color': 'Color',
        'font_encoding': 'str',
        'value': 'str',
        'mode': 'str',
        'rotate': 'RotateConfig',
        'translate': 'Translate',
        'transform': 'Transform'
    }

    attribute_map = {
        'format': 'format',
        'size': 'size',
        'font': 'font',
        'color': 'color',
        'font_encoding': 'fontEncoding',
        'value': 'value',
        'mode': 'mode',
        'rotate': 'rotate',
        'translate': 'translate',
        'transform': 'transform'
    }

    def __init__(self, format=None, size=None, font=None, color=None, font_encoding=None, value=None, mode=None, rotate=None, translate=None, transform=None):  # noqa: E501
        """Text - a model defined in Swagger"""  # noqa: E501

        self._format = None
        self._size = None
        self._font = None
        self._color = None
        self._font_encoding = None
        self._value = None
        self._mode = None
        self._rotate = None
        self._translate = None
        self._transform = None
        self.discriminator = None

        if format is not None:
            self.format = format
        if size is not None:
            self.size = size
        if font is not None:
            self.font = font
        if color is not None:
            self.color = color
        if font_encoding is not None:
            self.font_encoding = font_encoding
        self.value = value
        if mode is not None:
            self.mode = mode
        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 format(self):
        """Gets the format of this Text.  # noqa: E501


        :return: The format of this Text.  # noqa: E501
        :rtype: bool
        """
        return self._format

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


        :param format: The format of this Text.  # noqa: E501
        :type: bool
        """

        self._format = format

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

        The font size in points, e.g. 12. If set to 0, the size is chosen such that text fits stamp size (not allowed if operator is within transformation operator).  # noqa: E501

        :return: The size of this Text.  # noqa: E501
        :rtype: int
        """
        return self._size

    @size.setter
    def size(self, size):
        """Sets the size of this Text.

        The font size in points, e.g. 12. If set to 0, the size is chosen such that text fits stamp size (not allowed if operator is within transformation operator).  # noqa: E501

        :param size: The size of this Text.  # noqa: E501
        :type: int
        """

        self._size = size

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


        :return: The font of this Text.  # noqa: E501
        :rtype: str
        """
        return self._font

    @font.setter
    def font(self, font):
        """Sets the font of this Text.


        :param font: The font of this Text.  # noqa: E501
        :type: str
        """

        self._font = font

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


        :return: The color of this Text.  # noqa: E501
        :rtype: Color
        """
        return self._color

    @color.setter
    def color(self, color):
        """Sets the color of this Text.


        :param color: The color of this Text.  # noqa: E501
        :type: Color
        """

        self._color = color

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


        :return: The font_encoding of this Text.  # noqa: E501
        :rtype: str
        """
        return self._font_encoding

    @font_encoding.setter
    def font_encoding(self, font_encoding):
        """Sets the font_encoding of this Text.


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

        self._font_encoding = font_encoding

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


        :return: The value of this Text.  # noqa: E501
        :rtype: str
        """
        return self._value

    @value.setter
    def value(self, value):
        """Sets the value of this Text.


        :param value: The value of this Text.  # noqa: E501
        :type: str
        """
        if value is None:
            raise ValueError("Invalid value for `value`, must not be `None`")  # noqa: E501

        self._value = value

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


        :return: The mode of this Text.  # noqa: E501
        :rtype: str
        """
        return self._mode

    @mode.setter
    def mode(self, mode):
        """Sets the mode of this Text.


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

        self._mode = mode

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


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

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


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

        self._rotate = rotate

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


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

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


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

        self._translate = translate

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


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

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


        :param transform: The transform of this Text.  # 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(Text, 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, Text):
            return False

        return self.__dict__ == other.__dict__

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