public ResourceResult apply(ResourceMetadata<?> in) {
Builder builder = ResourceResult.builder();
Location provider = in.getLocation();
while (provider.getParent() != null)
provider = provider.getParent();
builder.provider(provider.getId());
builder.location(in.getLocation().getId());
builder.type(in.getType().toString().toLowerCase());
builder.id(in.getProviderId());
builder.name(in.getName());
return builder.build();