# 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 MessagePart(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 = {
        'body': 'MessagePartBody',
        'filename': 'str',
        'headers': 'list[MessagePartHeader]',
        'mime_type': 'str',
        'part_id': 'str',
        'parts': 'list[MessagePart]'
    }

    attribute_map = {
        'body': 'body',
        'filename': 'filename',
        'headers': 'headers',
        'mime_type': 'mimeType',
        'part_id': 'partId',
        'parts': 'parts'
    }

    def __init__(self, body=None, filename=None, headers=None, mime_type=None, part_id=None, parts=None):  # noqa: E501
        """MessagePart - a model defined in Swagger"""  # noqa: E501
        self._body = None
        self._filename = None
        self._headers = None
        self._mime_type = None
        self._part_id = None
        self._parts = None
        self.discriminator = None
        if body is not None:
            self.body = body
        if filename is not None:
            self.filename = filename
        if headers is not None:
            self.headers = headers
        if mime_type is not None:
            self.mime_type = mime_type
        if part_id is not None:
            self.part_id = part_id
        if parts is not None:
            self.parts = parts

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


        :return: The body of this MessagePart.  # noqa: E501
        :rtype: MessagePartBody
        """
        return self._body

    @body.setter
    def body(self, body):
        """Sets the body of this MessagePart.


        :param body: The body of this MessagePart.  # noqa: E501
        :type: MessagePartBody
        """

        self._body = body

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

        The filename of the attachment. Only present if this message part represents an attachment.  # noqa: E501

        :return: The filename of this MessagePart.  # noqa: E501
        :rtype: str
        """
        return self._filename

    @filename.setter
    def filename(self, filename):
        """Sets the filename of this MessagePart.

        The filename of the attachment. Only present if this message part represents an attachment.  # noqa: E501

        :param filename: The filename of this MessagePart.  # noqa: E501
        :type: str
        """

        self._filename = filename

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

        List of headers on this message part. For the top-level message part, representing the entire message payload, make it contain the standard RFC 2822 email headers such as `To`, `From`, and `Subject`.  # noqa: E501

        :return: The headers of this MessagePart.  # noqa: E501
        :rtype: list[MessagePartHeader]
        """
        return self._headers

    @headers.setter
    def headers(self, headers):
        """Sets the headers of this MessagePart.

        List of headers on this message part. For the top-level message part, representing the entire message payload, make it contain the standard RFC 2822 email headers such as `To`, `From`, and `Subject`.  # noqa: E501

        :param headers: The headers of this MessagePart.  # noqa: E501
        :type: list[MessagePartHeader]
        """

        self._headers = headers

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

        The MIME type of the message part.  # noqa: E501

        :return: The mime_type of this MessagePart.  # noqa: E501
        :rtype: str
        """
        return self._mime_type

    @mime_type.setter
    def mime_type(self, mime_type):
        """Sets the mime_type of this MessagePart.

        The MIME type of the message part.  # noqa: E501

        :param mime_type: The mime_type of this MessagePart.  # noqa: E501
        :type: str
        """

        self._mime_type = mime_type

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

        The immutable ID of the message part.  # noqa: E501

        :return: The part_id of this MessagePart.  # noqa: E501
        :rtype: str
        """
        return self._part_id

    @part_id.setter
    def part_id(self, part_id):
        """Sets the part_id of this MessagePart.

        The immutable ID of the message part.  # noqa: E501

        :param part_id: The part_id of this MessagePart.  # noqa: E501
        :type: str
        """

        self._part_id = part_id

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

        The child MIME message parts of this part. This only applies to container MIME message parts, for example `multipart/*`. For non- container MIME message part types, such as `text/plain`, this field is empty. For more information, see RFC 1521.  # noqa: E501

        :return: The parts of this MessagePart.  # noqa: E501
        :rtype: list[MessagePart]
        """
        return self._parts

    @parts.setter
    def parts(self, parts):
        """Sets the parts of this MessagePart.

        The child MIME message parts of this part. This only applies to container MIME message parts, for example `multipart/*`. For non- container MIME message part types, such as `text/plain`, this field is empty. For more information, see RFC 1521.  # noqa: E501

        :param parts: The parts of this MessagePart.  # noqa: E501
        :type: list[MessagePart]
        """

        self._parts = parts

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

        return self.__dict__ == other.__dict__

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