private Resource.Type getRequestType(Map<String, Object> properties) throws AmbariException {
    Set<String> requestFKs = getRequestForeignKeys(properties).keySet();
    for (TypeRegistration registration : typeRegistrations.values()) {
      Collection<String> typeFKs = new HashSet<>(registration.getForeignKeyInfo().values());
      typeFKs.add(registration.getFKPropertyName());
      if (requestFKs.equals(typeFKs)) {
        return registration.getType();
      }
    }
    throw new AmbariException("Couldn't determine resource type based on request properties");
  }
Get the type of the parent resource from the request properties.

@param properties  request properties

@return the parent resource type based on the request properties

@throws AmbariException  if unable to determine the parent resource type
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java