@classmethod
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:
        if hasattr(path_spec, property_name):
            properties[property_name] = getattr(path_spec, property_name)
    return properties
