code: def _resource(resource, pretty: bool = None, **data):
      
      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))
docs: The callback func that will be hooked to the generic resource commands