# coding: utf-8

"""
    COIN Number Portability API V3

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

    OpenAPI spec version: 3.0.0
    Contact: servicedesk@coin.nl
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re

import six


class Header(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 = {
        'receiver': 'Receiver',
        'sender': 'Sender',
        'timestamp': 'str'
    }

    attribute_map = {
        'receiver': 'receiver',
        'sender': 'sender',
        'timestamp': 'timestamp'
    }

    def __init__(self, receiver=None, sender=None, timestamp=None):
        """Header - a model defined in Swagger"""
        self._receiver = None
        self._sender = None
        self._timestamp = None
        self.discriminator = None
        self.receiver = receiver
        self.sender = sender
        self.timestamp = timestamp

    @property
    def receiver(self):
        """Gets the receiver of this Header.


        :return: The receiver of this Header.
        :rtype: Receiver
        """
        return self._receiver

    @receiver.setter
    def receiver(self, receiver):
        """Sets the receiver of this Header.


        :param receiver: The receiver of this Header.
        :type: Receiver
        """
        if receiver is None:
            raise ValueError("Invalid value for `receiver`, must not be `None`")

        self._receiver = receiver

    @property
    def sender(self):
        """Gets the sender of this Header.


        :return: The sender of this Header.
        :rtype: Sender
        """
        return self._sender

    @sender.setter
    def sender(self, sender):
        """Sets the sender of this Header.


        :param sender: The sender of this Header.
        :type: Sender
        """
        if sender is None:
            raise ValueError("Invalid value for `sender`, must not be `None`")

        self._sender = sender

    @property
    def timestamp(self):
        """Gets the timestamp of this Header.


        :return: The timestamp of this Header.
        :rtype: str
        """
        return self._timestamp

    @timestamp.setter
    def timestamp(self, timestamp):
        """Sets the timestamp of this Header.


        :param timestamp: The timestamp of this Header.
        :type: str
        """
        if timestamp is None:
            raise ValueError("Invalid value for `timestamp`, must not be `None`")  # noqa: E501
        if timestamp is not None and not re.search(r'[0-9]{14}', timestamp):  # noqa: E501
            raise ValueError(r"Invalid value for `timestamp`, must be a follow pattern or equal to `/[0-9]{14}/`")  # noqa: E501

        self._timestamp = timestamp

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

        return self.__dict__ == other.__dict__

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