How to wrap an existing Gradle task with parameters into a custom task?

I am trying to create a custom task which invokes an existing task with parameters which are specific to my project. Here is how I invoke the task from the command line:

./gradlew downloadJson -Pendpoint=http://example.com/foo -Pdestination=src/main/com/example/foo.json

I would like to create a downloadFoo task which I can invoke without specifying the parameters explicitely.

tasks.register("downloadFoo" /* type needed? */) {
    // What goes here?
}

Here is the wrapper task implementation I was looking for:

import com.some.external.plugin.DownloadJsonTask

tasks.register("downloadFoo", DownloadJsonTask) { task ->
    description("Downloads foo.")
    group("Foo")
    task.endpointUrl.set("http://example.com/foo")
    task.schemaFilePath.set("src/main/com/example/foo.json")
}