code: def GetProperties(cls, path_spec):
      
      properties = {}
  
      for property_name in cls.PROPERTY_NAMES:
        # Note that we do not want to set the properties when not used.
        if hasattr(path_spec, property_name):
          properties[property_name] = getattr(path_spec, property_name)
  
      return properties
docs: Retrieves a dictionary containing the path specification properties.
  
      Args:
        path_spec (PathSpec): path specification.
  
      Returns:
        dict[str, str]: path specification properties.
  
      Raises:
        dict: path specification properties.