code: def only_client_type(func: Callable[PS, RT]) -> Callable[PS, RT]:
      @functools.wraps(func)
      def checker(*args, **kwargs) -> RT:
          if args[0]._api_type == "client_type":
              return func(*args, **kwargs)
  
          ec2_doc_link = "https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html"
          raise AirflowException(
              f"""
              This method is only callable when using client_type API for interacting with EC2.
              Create the EC2Hook object as follows to use this method
  
              ec2 = EC2Hook(api_type="client_type")
  
              Read following for details on client_type and resource_type APIs:
              1. {ec2_doc_link}#client
              2. {ec2_doc_link}#service-resource
              """
          )
  
      return checker
  
file_path: airflow/airflow/providers/amazon/aws/hooks/ec2.py
imports: from __future__ import annotations
  import functools
  import time
  from typing import Callable, TypeVar
  from airflow.exceptions import AirflowException
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
  from airflow.typing_compat import ParamSpec
label_desc: Use image node_id 1 for calling a global function with example usage: only_client_type(func) and returns: checker, func