<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GetProperties(cls, path_spec):
 """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. """

    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