code: def _ExtractPath(response, pathspec_attribute=None):
    
    path_specification = response
  
    if pathspec_attribute is not None:
      if response.HasField(pathspec_attribute):
        path_specification = response.Get(pathspec_attribute)
  
    if path_specification.HasField("pathspec"):
      path_specification = path_specification.pathspec
  
    if path_specification.HasField("path"):
      path_specification = path_specification.path
  
    if isinstance(path_specification, Text):
      return path_specification
    return None
docs: Returns the path from a client action response as a string.
  
    Args:
      response: A client action response.
      pathspec_attribute: Specifies the field which stores the pathspec.
  
    Returns:
      The path as a string or None if no path is found.