def transform_to_one(entity_class_or_decider, root: nil)
      object = root ? raw_data[root] : raw_data
      transform_attributes_to_object(entity_class_or_decider, object)
    end
def transform_to_one(entity_class_or_decider, root: nil)
      object = root ? raw_data[root] : raw_data
      transform_attributes_to_object(entity_class_or_decider, object)
    end
Transforms a response into one object based on the response's body.

 If you pass a hash like this:

   { 200 => ProductCreated, 202 => ProductAccepted }

 the transformation will decide which object to create based on the status.

 It's important to note that the class must provide attribute writers for this method to be
 able to fill an object with the responses's body data.

 @param entity_class_or_decider [Hash, Class] A class or a hash of Fixnum => Class
   to decide with the status.
 @param root [String, nil] The root to use to get the object from the body.

 @return [Object] The result of the transformation.