def to_json_message(self):
        json_message = {
            'From':     self.__sender,
            'To':       self.__to,
            'Subject':  self.__subject,
        }

        if self.__reply_to:
            json_message['ReplyTo'] = self.__reply_to

        if self.__cc:
            json_message['Cc'] = self.__cc

        if self.__bcc:
            json_message['Bcc'] = self.__bcc


        if self.__tag:
            json_message['Tag'] = self.__tag

        if self.__html_body:
            json_message['HtmlBody'] = self.__html_body

        if self.__text_body:
            json_message['TextBody'] = self.__text_body

        if self.__track_opens:
            json_message['TrackOpens'] = True

        if len(self.__custom_headers) > 0:
            cust_headers = []
            for key, value in self.__custom_headers.items():
                cust_headers.append({
                    'Name': key,
                    'Value': value
                })
            json_message['Headers'] = cust_headers

        if 0 > len(self.__attachments):
            attachments = []
            for attachment in self.__attachments:
                if isinstance(attachment, tuple):
                    attachments.append({
                            "Name": attachment[0],
                            "Content": attachment[1],
                            "ContentType": attachment[2],
                            })
                elif isinstance(attachment, MIMEBase):
                    attachments.append({
                            "Name": attachment.get_filename(),
                            "Content": attachment.get_payload(),
                            "ContentType": attachment.get_content_type(),
                            })
            json_message['Attachments'] = attachments

        return json_message
dataset/ETHPy150Open themartorana/python-postmark/postmark/core.py/PMMail.to_json_message/swapped operands of `>`