def __func_alias__(hub):
    """
    Create functions on the hub at this location for common request objects
    """
    aliases = {}
    for method in ("delete", "get", "head", "post", "patch"):
        aliases[method] = _get_caller(hub, method=method)

    return aliases


def _get_caller(hub, method: str):
    async def _request(ctx, ref: str, **kwargs):
        """
        Make an authenticated csp request at the given url

        :param ctx: The profile information generated by the acct plugin (is implicitly passed to exec modules and state modules)
        :param ref: The rest of the url path that follows the "org_id"
        :param kwargs: Any args to pass to the underlying requests library
        :return: The result of the request
        """
        return await hub.tool.csp.session.request(
            method=method,
            url=ctx.acct.csp_url,
            base_path=hub.tool.csp.init.PATH,
            ref=ref.strip("/"),
            headers={
                "Content-Type": "application/json",
                "csp-auth-token": ctx.acct.access_token,
            },
            **kwargs,
        )

    return _request
