docstr: Generates an endpoint dict.
  
  Parameters
  ----------
  name : str
      Endpoint name to add or update
  
  obj :  func
      Object that backs the endpoint. See add() for a complete
      description.
  
  description : str
      Description of the endpoint
  
  version : int
      The version. Defaults to 1.
  
  Returns
  -------
  dict
      Keys:
          name : str
              The name provided.
  
          version : int
              The version provided.
  
          description : str
              The provided description.
  
          type : str
              The type of the endpoint.
  
          endpoint_obj : object
              The wrapper around the obj provided that can be used to
              generate the code and dependencies for the endpoint.
  
  Raises
  ------
  TypeError
      When obj is not one of the expected types.
docstr_tok: ["Generates","an","endpoint","dict",".","Parameters","--","--","--","--","--","name",":","str","Endpoint","name","to","add","or","update","obj",":","func","Object","that","backs","the","endpoint",".","See","add","(",")","for","a","complete","description",".","description",":","str","Description","of","the","endpoint","version",":","int","The","version",".","Defaults","to","1",".","Returns","--","--","--","-","dict","Keys",":","name",":","str","The","name","provided",".","version",":","int","The","version","provided",".","description",":","str","The","provided","description",".","type",":","str","The","type","of","the","endpoint",".","endpoint_obj",":","object","The","wrapper","around","the","obj","provided","that","can","be","used","to","generate","the","code","and","dependencies","for","the","endpoint",".","Raises","--","--","--","TypeError","When","obj","is","not","one","of","the","expected","types","."]
code: def _gen_endpoint(
      self, name, obj, description, version=1, schema=None
  ):
      """Generates an endpoint dict.
  
      Parameters
      ----------
      name : str
          Endpoint name to add or update
  
      obj :  func
          Object that backs the endpoint. See add() for a complete
          description.
  
      description : str
          Description of the endpoint
  
      version : int
          The version. Defaults to 1.
  
      Returns
      -------
      dict
          Keys:
              name : str
                  The name provided.
  
              version : int
                  The version provided.
  
              description : str
                  The provided description.
  
              type : str
                  The type of the endpoint.
  
              endpoint_obj : object
                  The wrapper around the obj provided that can be used to
                  generate the code and dependencies for the endpoint.
  
      Raises
      ------
      TypeError
          When obj is not one of the expected types.
      """
      # check for invalid PO names
      _check_endpoint_name(name)
  
      if description is None:
          description = (
              obj.__doc__.strip() or ""
              if isinstance(obj.__doc__, str)
              else ""
          )
  
      endpoint_object = CustomQueryObject(
          query=obj,
          description=description,
      )
  
      return {
          "name": name,
          "version": version,
          "description": description,
          "type": "model",
          "endpoint_obj": endpoint_object,
          "dependencies": endpoint_object.get_dependencies(),
          "methods": endpoint_object.get_methods(),
          "required_files": [],
          "required_packages": [],
          "schema": copy.copy(schema),
      }
  
imports: import copy
  from re import compile
  import time
  import requests
  from .rest import RequestsNetworkWrapper, ServiceClient
  from .rest_client import RESTServiceClient, Endpoint
  from .custom_query_object import CustomQueryObject
  import os
  import logging
label_desc: Use image node_id 11 for calling the Client obj's underlying member method code with example usage: obj._gen_endpoint(name, obj, description, version, schema) and returns: dict