# coding: utf-8

"""
    Gmail API

    The Gmail API lets you view and manage Gmail mailbox data like threads, messages, and labels.  # noqa: E501

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

import pprint
import re  # noqa: F401

import six

class Message(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 = {
        'history_id': 'str',
        'id': 'str',
        'internal_date': 'str',
        'label_ids': 'list[str]',
        'payload': 'MessagePart',
        'raw': 'str',
        'size_estimate': 'int',
        'snippet': 'str',
        'thread_id': 'str'
    }

    attribute_map = {
        'history_id': 'historyId',
        'id': 'id',
        'internal_date': 'internalDate',
        'label_ids': 'labelIds',
        'payload': 'payload',
        'raw': 'raw',
        'size_estimate': 'sizeEstimate',
        'snippet': 'snippet',
        'thread_id': 'threadId'
    }

    def __init__(self, history_id=None, id=None, internal_date=None, label_ids=None, payload=None, raw=None, size_estimate=None, snippet=None, thread_id=None):  # noqa: E501
        """Message - a model defined in Swagger"""  # noqa: E501
        self._history_id = None
        self._id = None
        self._internal_date = None
        self._label_ids = None
        self._payload = None
        self._raw = None
        self._size_estimate = None
        self._snippet = None
        self._thread_id = None
        self.discriminator = None
        if history_id is not None:
            self.history_id = history_id
        if id is not None:
            self.id = id
        if internal_date is not None:
            self.internal_date = internal_date
        if label_ids is not None:
            self.label_ids = label_ids
        if payload is not None:
            self.payload = payload
        if raw is not None:
            self.raw = raw
        if size_estimate is not None:
            self.size_estimate = size_estimate
        if snippet is not None:
            self.snippet = snippet
        if thread_id is not None:
            self.thread_id = thread_id

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

        The ID of the last history record that modified this message.  # noqa: E501

        :return: The history_id of this Message.  # noqa: E501
        :rtype: str
        """
        return self._history_id

    @history_id.setter
    def history_id(self, history_id):
        """Sets the history_id of this Message.

        The ID of the last history record that modified this message.  # noqa: E501

        :param history_id: The history_id of this Message.  # noqa: E501
        :type: str
        """

        self._history_id = history_id

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

        The immutable ID of the message.  # noqa: E501

        :return: The id of this Message.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Message.

        The immutable ID of the message.  # noqa: E501

        :param id: The id of this Message.  # noqa: E501
        :type: str
        """

        self._id = id

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

        The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header.  # noqa: E501

        :return: The internal_date of this Message.  # noqa: E501
        :rtype: str
        """
        return self._internal_date

    @internal_date.setter
    def internal_date(self, internal_date):
        """Sets the internal_date of this Message.

        The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header.  # noqa: E501

        :param internal_date: The internal_date of this Message.  # noqa: E501
        :type: str
        """

        self._internal_date = internal_date

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

        List of IDs of labels applied to this message.  # noqa: E501

        :return: The label_ids of this Message.  # noqa: E501
        :rtype: list[str]
        """
        return self._label_ids

    @label_ids.setter
    def label_ids(self, label_ids):
        """Sets the label_ids of this Message.

        List of IDs of labels applied to this message.  # noqa: E501

        :param label_ids: The label_ids of this Message.  # noqa: E501
        :type: list[str]
        """

        self._label_ids = label_ids

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


        :return: The payload of this Message.  # noqa: E501
        :rtype: MessagePart
        """
        return self._payload

    @payload.setter
    def payload(self, payload):
        """Sets the payload of this Message.


        :param payload: The payload of this Message.  # noqa: E501
        :type: MessagePart
        """

        self._payload = payload

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

        Always populate this field. Make this entire email message in an RFC 2822 formatted and base64url encoded string. Returned in `messages.get` and `drafts.get` responses when the `format=RAW` parameter is supplied. When creating a draft, the complete message needs to be passed in the raw parameter, see the example: From: John Doe <jdoe@machine.example>  To: Mary Smith <mary@example.net>  Subject: Saying Hello  Date [optional]: Fri, 21 Nov 1997 09:55:06 -0600 Message-ID [optional]: <1234@local.machine.example> ...<other RFC 2822 headers> ... Hi Mary, This is the body of the message. Regards, John Doe   # noqa: E501

        :return: The raw of this Message.  # noqa: E501
        :rtype: str
        """
        return self._raw

    @raw.setter
    def raw(self, raw):
        """Sets the raw of this Message.

        Always populate this field. Make this entire email message in an RFC 2822 formatted and base64url encoded string. Returned in `messages.get` and `drafts.get` responses when the `format=RAW` parameter is supplied. When creating a draft, the complete message needs to be passed in the raw parameter, see the example: From: John Doe <jdoe@machine.example>  To: Mary Smith <mary@example.net>  Subject: Saying Hello  Date [optional]: Fri, 21 Nov 1997 09:55:06 -0600 Message-ID [optional]: <1234@local.machine.example> ...<other RFC 2822 headers> ... Hi Mary, This is the body of the message. Regards, John Doe   # noqa: E501

        :param raw: The raw of this Message.  # noqa: E501
        :type: str
        """

        self._raw = raw

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

        Estimated size in bytes of the message.  # noqa: E501

        :return: The size_estimate of this Message.  # noqa: E501
        :rtype: int
        """
        return self._size_estimate

    @size_estimate.setter
    def size_estimate(self, size_estimate):
        """Sets the size_estimate of this Message.

        Estimated size in bytes of the message.  # noqa: E501

        :param size_estimate: The size_estimate of this Message.  # noqa: E501
        :type: int
        """

        self._size_estimate = size_estimate

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

        A short part of the message text.  # noqa: E501

        :return: The snippet of this Message.  # noqa: E501
        :rtype: str
        """
        return self._snippet

    @snippet.setter
    def snippet(self, snippet):
        """Sets the snippet of this Message.

        A short part of the message text.  # noqa: E501

        :param snippet: The snippet of this Message.  # noqa: E501
        :type: str
        """

        self._snippet = snippet

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

        The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match.   # noqa: E501

        :return: The thread_id of this Message.  # noqa: E501
        :rtype: str
        """
        return self._thread_id

    @thread_id.setter
    def thread_id(self, thread_id):
        """Sets the thread_id of this Message.

        The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match.   # noqa: E501

        :param thread_id: The thread_id of this Message.  # noqa: E501
        :type: str
        """

        self._thread_id = thread_id

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

        return self.__dict__ == other.__dict__

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