To make it easier to write the scripts in a IDE, you might want to add a "annotation only" @BaseScript class.
For a SCIM/REST script, this almost works:
package ch.empa.connector.ide
import com.evolveum.polygon.scimrest.groovy.*
import com.evolveum.polygon.scimrest.groovy.api.*
import groovy.transform.CompileStatic
/**
* IDE helper base class for SCIM search scripts.
* Provides autocompletion and static type hints only.
* Never executed at runtime.
*/
@CompileStatic
abstract class RestSearchScript extends Script {
AuthenticationCustomizationBuilder authentication(
@DelegatesTo(AuthenticationCustomizationBuilder)
Closure<?> body = null
) { null }
RestRelationshipBuilder relationship(
@DelegatesTo(RestRelationshipBuilder)
Closure<?> body = null
) { null }
GroovyRestHandlerBuilder objectClass(
String name,
@DelegatesTo(value = BaseOperationSupportBuilder,
strategy = Closure.DELEGATE_ONLY)
Closure<?> body = null
) { null }
Object run() { null }
}
then in your script you can do:
package ch.empa.connector.ide
import com.evolveum.polygon.scimrest.groovy.*
import com.evolveum.polygon.scimrest.groovy.api.*
import groovy.transform.CompileStatic
/**
* IDE helper base class for SCIM search scripts.
* Provides autocompletion and static type hints only.
* Never executed at runtime.
*/
@CompileStatic
abstract class RestSearchScript extends Script {
AuthenticationCustomizationBuilder authentication(
@DelegatesTo(AuthenticationCustomizationBuilder)
Closure<?> body = null
) { null }
RestRelationshipBuilder relationship(
@DelegatesTo(RestRelationshipBuilder)
Closure<?> body = null
) { null }
GroovyRestHandlerBuilder objectClass(
String name,
@DelegatesTo(value = BaseOperationSupportBuilder,
strategy = Closure.DELEGATE_ONLY)
Closure<?> body = null
) { null }
Object run() { null }
}
Unfortunately I am still not doing it fully correctly and it fails at runtime, but the compile time type information is correct
To make it easier to write the scripts in a IDE, you might want to add a "annotation only"
@BaseScriptclass.For a SCIM/REST script, this almost works:
then in your script you can do:
Unfortunately I am still not doing it fully correctly and it fails at runtime, but the compile time type information is correct