//validate object's values as values for new resource
vartype=value.type;
if(type===undefined){
returnPromise.reject("Reference resource type undefined. `type` attribute should be set to one of these values: "+this.params.allowed_types.join(", ")+".");
returnPromise.reject("Resource of id `"+supposed_resource_id+"` is not of allowed type. Allowed types are: ["+this.params.allowed_types.join(", ")+"]");