def METHOD_NAME(self, request):
    func = self._hooks['get_temporary_credential']
    if callable(func):
        return func(request.token)
    raise RuntimeError(
        '"get_temporary_credential" hook is required.'
    )