def _update_attachments_to_cloud(self):
url = self.build_url(self._endpoints.get('<STR_LIT>').format(<EOL>id=self._parent.object_id))<EOL>for attachment in self.__attachments:<EOL><INDENT>if attachment.on_cloud is False:<EOL><INDENT>response = self._parent.con.post(url,<EOL>data=attachment.to_api_data())<EOL>if not response:<EOL><INDENT>return False<EOL><DEDENT>data = response.json()<EOL>attachment.attachment_id = data.get('<STR_LIT:id>')<EOL>attachment.content = data.get(self._cc('<STR_LIT>'), None)<EOL>attachment.on_cloud = True<EOL><DEDENT><DEDENT>for attachment in self.__removed_attachments:<EOL><INDENT>if attachment.on_cloud and attachment.attachment_id is not None:<EOL><INDENT>url = self.build_url(self._endpoints.get('<STR_LIT>').format(<EOL>id=self._parent.object_id, ida=attachment.attachment_id))<EOL>response = self._parent.con.delete(url)<EOL>if not response:<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT>self.__removed_attachments = []  <EOL>log.debug('<STR_LIT>'.format(<EOL>self._parent.object_id))<EOL>return True<EOL>
Push new, unsaved attachments to the cloud and remove removed
        attachments. This method should not be called for non draft messages.