def _resource(resource, pretty: bool = None, **data):
    """The callback func that will be hooked to the generic resource commands"""
    data = clean_data(data)

    ctx = click.get_current_context()
    if ctx.obj.get("env_prefix"):
        data["env_prefix"] = ctx.obj["env_prefix"]

    rsp = resource(**data)
    dump = partial(json.dumps, indent=4) if pretty else partial(json.dumps)
    click.echo(dump(rsp))
The callback func that will be hooked to the generic resource commands