class_docstr: Handles sending notifications via the configured notifiers
      
docstr: Initializes Notifier class
  
  Args:
      notifier_config (dict): A dictionary containing configuration for the notifications.
docstr_tok: ["Initializes","Notifier","class","Args",":","notifier_config","(","dict",")",":","A","dictionary","containing","configuration","for","the","notifications","."]
code: def __init__(self, notifier_config):
      """Initializes Notifier class
  
      Args:
          notifier_config (dict): A dictionary containing configuration for the notifications.
      """
  
      self.logger = structlog.get_logger()
      self.notifier_config = notifier_config
      self.last_analysis = dict()
  
      enabled_notifiers = list()
      self.logger = structlog.get_logger()
      self.twilio_configured = self._validate_required_config(
          "twilio", notifier_config
      )
      if self.twilio_configured:
          self.twilio_client = TwilioNotifier(
              twilio_key=notifier_config["twilio"]["required"]["key"],
              twilio_secret=notifier_config["twilio"]["required"][
                  "secret"
              ],
              twilio_sender_number=notifier_config["twilio"][
                  "required"
              ]["sender_number"],
              twilio_receiver_number=notifier_config["twilio"][
                  "required"
              ]["receiver_number"],
          )
          enabled_notifiers.append("twilio")
  
      self.discord_configured = self._validate_required_config(
          "discord", notifier_config
      )
      if self.discord_configured:
          self.discord_client = DiscordNotifier(
              webhook=notifier_config["discord"]["required"]["webhook"],
              username=notifier_config["discord"]["required"][
                  "username"
              ],
              avatar=notifier_config["discord"]["optional"]["avatar"],
          )
          enabled_notifiers.append("discord")
  
      self.slack_configured = self._validate_required_config(
          "slack", notifier_config
      )
      if self.slack_configured:
          self.slack_client = SlackNotifier(
              slack_webhook=notifier_config["slack"]["required"][
                  "webhook"
              ]
          )
          enabled_notifiers.append("slack")
  
      self.gmail_configured = self._validate_required_config(
          "gmail", notifier_config
      )
      if self.gmail_configured:
          self.gmail_client = GmailNotifier(
              username=notifier_config["gmail"]["required"]["username"],
              password=notifier_config["gmail"]["required"]["password"],
              destination_addresses=notifier_config["gmail"][
                  "required"
              ]["destination_emails"],
          )
          enabled_notifiers.append("gmail")
  
      self.telegram_configured = self._validate_required_config(
          "telegram", notifier_config
      )
      if self.telegram_configured:
          self.telegram_client = TelegramNotifier(
              token=notifier_config["telegram"]["required"]["token"],
              chat_id=notifier_config["telegram"]["required"][
                  "chat_id"
              ],
              parse_mode=notifier_config["telegram"]["optional"][
                  "parse_mode"
              ],
          )
          enabled_notifiers.append("telegram")
  
      self.webhook_configured = self._validate_required_config(
          "webhook", notifier_config
      )
      if self.webhook_configured:
          self.webhook_client = WebhookNotifier(
              url=notifier_config["webhook"]["required"]["url"],
              username=notifier_config["webhook"]["optional"][
                  "username"
              ],
              password=notifier_config["webhook"]["optional"][
                  "password"
              ],
          )
          enabled_notifiers.append("webhook")
  
      self.stdout_configured = self._validate_required_config(
          "stdout", notifier_config
      )
      if self.stdout_configured:
          self.stdout_client = StdoutNotifier()
          enabled_notifiers.append("stdout")
  
      self.logger.info("enabled notifers: %s", enabled_notifiers)
  
imports: import json
  import structlog
  from jinja2 import Template
  from notifiers.twilio_client import TwilioNotifier
  from notifiers.slack_client import SlackNotifier
  from notifiers.discord_client import DiscordNotifier
  from notifiers.gmail_client import GmailNotifier
  from notifiers.telegram_client import TelegramNotifier
  from notifiers.webhook_client import WebhookNotifier
  from notifiers.stdout_client import StdoutNotifier
label_desc: Use image node_id 1 to create a new Notifier object  with example: obj = Notifier(notifier_config)