resource to object