class_docstr: Transfers a mail attachment from a mail server into s3 bucket.
  
  .. seealso::
      For more information on how to use this operator, take a look at the guide:
      :ref:`howto/operator:ImapAttachmentToS3Operator`
  
  :param imap_attachment_name: The file name of the mail attachment that you want to transfer.
  :param s3_bucket: The targeted s3 bucket. This is the S3 bucket where the file will be downloaded.
  :param s3_key: The destination file name in the s3 bucket for the attachment.
  :param imap_check_regex: If set checks the `imap_attachment_name` for a regular expression.
  :param imap_mail_folder: The folder on the mail server to look for the attachment.
  :param imap_mail_filter: If set other than 'All' only specific mails will be checked.
      See :py:meth:`imaplib.IMAP4.search` for details.
  :param s3_overwrite: If set overwrites the s3 key if already exists.
  :param imap_conn_id: The reference to the connection details of the mail server.
  :param aws_conn_id: AWS connection to use.
docstr: Execute the transfer from the email server (via imap) into s3.
  
  :param context: The context while executing.
code: def execute(self, context: Context) -> None:
      """
      Execute the transfer from the email server (via imap) into s3.
  
      :param context: The context while executing.
      """
      self.log.info(
          "Transferring mail attachment %s from mail server via imap to s3 key %s...",
          self.imap_attachment_name,
          self.s3_key,
      )
  
      with ImapHook(imap_conn_id=self.imap_conn_id) as imap_hook:
          imap_mail_attachments = imap_hook.retrieve_mail_attachments(
              name=self.imap_attachment_name,
              check_regex=self.imap_check_regex,
              latest_only=True,
              mail_folder=self.imap_mail_folder,
              mail_filter=self.imap_mail_filter,
          )
  
      s3_hook = S3Hook(aws_conn_id=self.aws_conn_id)
      s3_hook.load_bytes(
          bytes_data=imap_mail_attachments[0][1],
          bucket_name=self.s3_bucket,
          key=self.s3_key,
          replace=self.s3_overwrite,
      )
  
file_path: airflow/airflow/providers/amazon/aws/transfers/imap_attachment_to_s3.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Sequence
  from airflow.models import BaseOperator
  from airflow.providers.amazon.aws.hooks.s3 import S3Hook
  from airflow.providers.imap.hooks.imap import ImapHook
label_desc: Use image node_id 2 for calling the ImapAttachmentToS3Operator obj's underlying member method code with example usage: obj.execute(context) without return types