class_docstr: Stackdriver Hook for connecting with Google Cloud Stackdriver.
code: def _toggle_channel_status(
      self,
      new_state: bool,
      project_id: str = PROVIDE_PROJECT_ID,
      filter_: str | None = None,
      retry: Retry | _MethodDefault = DEFAULT,
      timeout: float | None = None,
      metadata: Sequence[tuple[str, str]] = (),
  ) -> None:
      client = self._get_channel_client()
      channels = client.list_notification_channels(
          request={"name": f"projects/{project_id}", "filter": filter_}
      )
      for channel in channels:
          if channel.enabled != bool(new_state):
              channel.enabled = bool(new_state)
              mask = FieldMask(paths=["enabled"])
              client.update_notification_channel(
                  request={
                      "notification_channel": channel,
                      "update_mask": mask,
                  },
                  retry=retry,
                  timeout=timeout,
                  metadata=metadata,
              )
  
imports: from __future__ import annotations
  import contextlib
  import json
  from typing import TYPE_CHECKING, Any, Sequence
  from google.api_core.exceptions import InvalidArgument
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
  from google.cloud import monitoring_v3
  from google.cloud.monitoring_v3 import AlertPolicy, NotificationChannel
  from google.protobuf.field_mask_pb2 import FieldMask
  from googleapiclient.errors import HttpError
  from airflow.exceptions import AirflowException
  from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID, GoogleBaseHook
label_desc: Use image node_id 11 for calling the StackdriverHook obj's underlying member method code with example usage: obj._toggle_channel_status(new_state, project_id, filter_, retry, timeout, metadata) without return types