blob: 15dd9e5247517b6ed8ff834b4871f63baff911d3 [file] [log] [blame]
:py:mod:`airflow.providers.imap.sensors.imap_attachment`
========================================================
.. py:module:: airflow.providers.imap.sensors.imap_attachment
.. autoapi-nested-parse::
This module allows you to poke for attachments on a mail server.
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.imap.sensors.imap_attachment.ImapAttachmentSensor
.. py:class:: ImapAttachmentSensor(*, attachment_name, check_regex=False, mail_folder='INBOX', mail_filter='All', conn_id='imap_default', **kwargs)
Bases: :py:obj:`airflow.sensors.base.BaseSensorOperator`
Waits for a specific attachment on a mail server.
:param attachment_name: The name of the attachment that will be checked.
:param check_regex: If set to True the attachment's name will be parsed as regular expression.
Through this you can get a broader set of attachments
that it will look for than just only the equality of the attachment name.
:param mail_folder: The mail folder in where to search for the attachment.
:param mail_filter: If set other than 'All' only specific mails will be checked.
See :py:meth:`imaplib.IMAP4.search` for details.
:param imap_conn_id: The :ref:`imap connection id <howto/connection:imap>` to run the sensor against.
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['attachment_name', 'mail_filter']
.. py:method:: poke(self, context)
Pokes for a mail attachment on the mail server.
:param context: The context that is being provided when poking.
:return: True if attachment with the given name is present and False if not.
:rtype: bool