class_docstr: Class for interacting with Vertex Prediction service.
class_docstr_tok: ["Class","for","interacting","with","Vertex","Prediction","service","."]
docstr: Gets an endpoint from Google Cloud AI Platform if endpoint exists.
  
  Args:
    ai_platform_serving_args: Dictionary containing arguments for pushing to
      AI Platform. For the full set of parameters supported, refer to
      https://googleapis.dev/python/aiplatform/latest/aiplatform.html?highlight=deploy#google.cloud.aiplatform.Model.deploy.
  
  Raises:
    RuntimeError: if an error is encountered when trying to get the endpoint
  
  Returns:
    The endpoint
docstr_tok: ["Gets","an","endpoint","from","Google","Cloud","AI","Platform","if","endpoint","exists",".","Args",":","ai_platform_serving_args",":","Dictionary","containing","arguments","for","pushing","to","AI","Platform",".","For","the","full","set","of","parameters","supported",",","refer","to","https",":","\/\/googleapis.dev\/python\/aiplatform\/latest\/aiplatform.html","?","highlight=deploy","#","google.cloud.aiplatform.Model.deploy",".","Raises",":","RuntimeError",":","if","an","error","is","encountered","when","trying","to","get","the","endpoint","Returns",":","The","endpoint"]
code: def _get_endpoint(
      self, ai_platform_serving_args: Dict[str, Any]
  ) -> aiplatform.Endpoint:
      """Gets an endpoint from Google Cloud AI Platform if endpoint exists.
  
      Args:
        ai_platform_serving_args: Dictionary containing arguments for pushing to
          AI Platform. For the full set of parameters supported, refer to
          https://googleapis.dev/python/aiplatform/latest/aiplatform.html?highlight=deploy#google.cloud.aiplatform.Model.deploy.
  
      Raises:
        RuntimeError: if an error is encountered when trying to get the endpoint
  
      Returns:
        The endpoint
      """
      endpoint_name = ai_platform_serving_args["endpoint_name"]
      endpoint = None
  
      endpoints = aiplatform.Endpoint.list(
          filter='display_name="{}"'.format(endpoint_name)
      )
  
      if endpoints:
          endpoint = endpoints[0]
      else:
          raise RuntimeError(
              "Error getting endpoint {}".format(endpoint_name)
          )
  
      return endpoint
  
imports: import abc
  import sys
  import time
  from typing import Any, Dict, Optional, Union
  from absl import logging
  from google.cloud import aiplatform
  from googleapiclient import discovery
  from googleapiclient import errors
  import tensorflow
label_desc: Use image node_id 4 for calling the VertexPredictionClient obj's underlying member method code with example usage: obj._get_endpoint(ai_platform_serving_args) and returns: endpoint