class_docstr: Undeploys a Model from an Endpoint, removing a DeployedModel from it, and freeing all used resources.
  
  :param project_id: Required. The ID of the Google Cloud project that the service belongs to.
  :param region: Required. The ID of the Google Cloud region that the service belongs to.
  :param endpoint_id:  Required. The ID of the Endpoint resource from which to undeploy a Model.
  :param deployed_model_id:  Required. The ID of the DeployedModel to be undeployed from the Endpoint.
  :param traffic_split: If this field is provided, then the Endpoint's
      [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be overwritten with it. If
      last DeployedModel is being undeployed from the Endpoint, the [Endpoint.traffic_split] will always
      end up empty when this call returns. A DeployedModel will be successfully undeployed only if it
      doesn't have any traffic assigned to it when this method executes, or if this field unassigns any
      traffic to it.
  :param retry: Designation of what errors, if any, should be retried.
  :param timeout: The timeout for this request.
  :param metadata: Strings which should be sent along with the request as metadata.
  :param gcp_conn_id: The connection ID to use connecting to Google Cloud.
  :param impersonation_chain: Optional service account to impersonate using short-term
      credentials, or chained list of accounts required to get the access_token
      of the last account in the list, which will be impersonated in the request.
      If set as a string, the account must grant the originating account
      the Service Account Token Creator IAM role.
      If set as a sequence, the identities from the list must grant
      Service Account Token Creator IAM role to the directly preceding identity, with first
      account from the list granting this role to the originating account (templated).
class_docstr_tok: ["Undeploys","a","Model","from","an","Endpoint",",","removing","a","DeployedModel","from","it",",","and","freeing","all","used","resources",".",":","param","project_id",":","Required",".","The","ID","of","the","Google","Cloud","project","that","the","service","belongs","to",".",":","param","region",":","Required",".","The","ID","of","the","Google","Cloud","region","that","the","service","belongs","to",".",":","param","endpoint_id",":","Required",".","The","ID","of","the","Endpoint","resource","from","which","to","undeploy","a","Model",".",":","param","deployed_model_id",":","Required",".","The","ID","of","the","DeployedModel","to","be","undeployed","from","the","Endpoint",".",":","param","traffic_split",":","If","this","field","is","provided",",","then","the","Endpoint's","[","traffic_split","]","[","google.cloud.aiplatform.v1.Endpoint.traffic_split","]","will","be","overwritten","with","it",".","If","last","DeployedModel","is","being","undeployed","from","the","Endpoint",",","the","[","Endpoint.traffic_split","]","will","always","end","up","empty","when","this","call","returns",".","A","DeployedModel","will","be","successfully","undeployed","only","if","it","does","n't","have","any","traffic","assigned","to","it","when","this","method","executes",",","or","if","this","field","unassigns","any","traffic","to","it",".",":","param","retry",":","Designation","of","what","errors",",","if","any",",","should","be","retried",".",":","param","timeout",":","The","timeout","for","this","request",".",":","param","metadata",":","Strings","which","should","be","sent","along","with","the","request","as","metadata",".",":","param","gcp_conn_id",":","The","connection","ID","to","use","connecting","to","Google","Cloud",".",":","param","impersonation_chain",":","Optional","service","account","to","impersonate","using","short-term","credentials",",","or","chained","list","of","accounts","required","to","get","the","access_token","of","the","last","account","in","the","list",",","which","will","be","impersonated","in","the","request",".","If","set","as","a","string",",","the","account","must","grant","the","originating","account","the","Service","Account","Token","Creator","IAM","role",".","If","set","as","a","sequence",",","the","identities","from","the","list","must","grant","Service","Account","Token","Creator","IAM","role","to","the","directly","preceding","identity",",","with","first","account","from","the","list","granting","this","role","to","the","originating","account","(","templated",")","."]
code: def execute(self, context: Context):
      hook = EndpointServiceHook(
          gcp_conn_id=self.gcp_conn_id,
          impersonation_chain=self.impersonation_chain,
      )
  
      self.log.info(
          "Removing a DeployedModel %s", self.deployed_model_id
      )
      operation = hook.undeploy_model(
          project_id=self.project_id,
          region=self.region,
          endpoint=self.endpoint_id,
          deployed_model_id=self.deployed_model_id,
          traffic_split=self.traffic_split,
          retry=self.retry,
          timeout=self.timeout,
          metadata=self.metadata,
      )
      hook.wait_for_operation(timeout=self.timeout, operation=operation)
      self.log.info("DeployedModel was removed successfully")
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Sequence
  from google.api_core.exceptions import NotFound
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
  from google.cloud.aiplatform_v1.types import DeployedModel, Endpoint, endpoint_service
  from airflow.providers.google.cloud.hooks.vertex_ai.endpoint_service import EndpointServiceHook
  from airflow.providers.google.cloud.links.vertex_ai import VertexAIEndpointLink, VertexAIEndpointListLink, VertexAIModelLink
  from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
label_desc: Use image node_id 2 for calling the UndeployModelOperator obj's underlying member method code with example usage: obj.execute(context) without return types