'Given either an object, a data dictionary or both, builds a ``Bundle``
for use throughout the ``dehydrate/hydrate`` cycle.
If no object is provided, an empty object from
``Resource._meta.object_class`` is created so that attempts to access
``bundle.obj`` do not fail.'

def build_bundle(self, obj=None, data=None, request=None, objects_saved=None, via_uri=None):

    if ((obj is None) and self._meta.object_class):
        obj = self._meta.object_class()
    return Bundle(obj=obj, data=data, request=request, objects_saved=objects_saved, via_uri=via_uri)
