original_docstring: Create a saved search.
  
    Endpoint creating saved search with provided parameters. Request payload
    should contain saved search `search_type` and `object_type`. Also it
    could contain saved search `name`, `filters`, and `is_visible` parameters. If
    there will any error during saved search creation, 400 status code and
    corresponding error will be returned.
  
    If no `name` parameter is provided, it will be generated atimatically.
    If no `is_visible` parameter is provided, the default value will be used.
      Defaults to `True`.
  
    Returns:
      Flask Response object containing JSON representation of created saved
      search or error message if error occurred.
    
docstring: Create a saved search.
  Endpoint creating saved search with provided parameters. Request payload
  should contain saved search `search_type` and `object_type`.
  
  If no `name` parameter is provided, it will be generated atimatically.
  If no `is_visible` parameter is provided, the default value will be used.
  Defaults to `True`.
docstring_tokens: Create a saved search . Endpoint creating saved search with provided parameters . Request payload should contain saved search ` search_type ` and ` object_type ` . If no ` name ` parameter is provided it will be generated atimatically . If no ` is_visible ` parameter is provided the default value will be used . Defaults to ` True ` .
code: def create_saved_search():
    """Create a saved search.
  
    Endpoint creating saved search with provided parameters. Request payload
    should contain saved search `search_type` and `object_type`. Also it
    could contain saved search `name`, `filters`, and `is_visible` parameters. If
    there will any error during saved search creation, 400 status code and
    corresponding error will be returned.
  
    If no `name` parameter is provided, it will be generated atimatically.
    If no `is_visible` parameter is provided, the default value will be used.
      Defaults to `True`.
  
    Returns:
      Flask Response object containing JSON representation of created saved
      search or error message if error occurred.
    """
    user = login.get_current_user(use_external_user=False)
  
    data = request.get_json()
  
    try:
      search = SavedSearch(
          data.get("name"),
          data.get("object_type"),
          user,
          data.get("search_type"),
          data.get("filters"),
          data.get("is_visible", True),
      )
    except ValidationError as error:
      return make_error_response(error.message, 400, force_json=True)
  
    user.saved_searches.append(search)
    db.session.commit()
  
    return json_success_response(search)
code_tokens: def create_saved_search ( ) : user = login . get_current_user ( use_external_user = False ) data = request . get_json ( ) try : search = SavedSearch ( data . get ( "name" ) , data . get ( "object_type" ) , user , data . get ( "search_type" ) , data . get ( "filters" ) , data . get ( "is_visible" , True ) , ) except ValidationError as error : return make_error_response ( error . message , 400 , force_json = True ) user . saved_searches . append ( search ) db . session . commit ( ) return json_success_response ( search )
short_docstring: Create a saved search.
short_docstring_tokens: Create a saved search .
comment: """Create a saved search.
  
    Endpoint creating saved search with provided parameters. Request payload
    should contain saved search `search_type` and `object_type`. Also it
    could contain saved search `name`, `filters`, and `is_visible` parameters. If
    there will any error during saved search creation, 400 status code and
    corresponding error will be returned.
  
    If no `name` parameter is provided, it will be generated atimatically.
    If no `is_visible` parameter is provided, the default value will be used.
      Defaults to `True`.
  
    Returns:
      Flask Response object containing JSON representation of created saved
      search or error message if error occurred.
    """