code: def metadata_wrapper(fn):
          
          @functools.wraps(fn)
          def wrapped_f(self, *args, **kwargs):
              self.last_metadata = {}
              self.last_metadata["url"] = self.configuration.host + args[0]
              self.last_metadata["method"] = args[1]
              self.last_metadata["timestamp"] = time.time()
              try:
                  return fn(self, *args, **kwargs)
              except Exception as e:
                  self.last_metadata["exception"] = e
                  raise
          return wrapped_f
docs: Save metadata of last api call.