I need a reactive choice parameter to give me 1-3 options when I choose a value for the extended choice parameter.

The following code gives me error that:

> 
> org.codehaus.groovy.control.MultipleCompilationErrorsException:
> startup failed: WorkflowScript: 4: Build parameters cannot be defined
> as maps @ line 4, column 9.
> [$class: 'CascadeChoiceParameter',
> ^
> 
> 
> 1 error
> 
> 
> 

```
pipeline {
    parameters {
        extendedChoice(defaultValue: 'none', description: 'Select the resource you want to modify', multiSelectDelimiter: ',', name: 'Resources', quoteValue: false, saveJSONParameterToFile: false, type: 'PT_SINGLE_SELECT', value: 'Compute, LIVE', visibleItemCount: 2) 
        [$class: 'CascadeChoiceParameter', 
        choiceType: 'PT_SINGLE_SELECT',
        description: 'Select a choice',
        filterLength: 1,
        filterable: true,
        name: 'choice1',
        referencedParameters: 'Resources',
        script: [$class: 'GroovyScript',
            fallbackScript: [
                classpath: [], 
                sandbox: true, 
                script: 'return ["ERROR"]'
            ],
            script: [
                classpath: [], 
                sandbox: true, 
                script: """
                    if (Resources == 'Compute') { 
                        return['aaa','bbb']
                    }
                    else {
                        return['ccc', 'ddd']
                    }
                """.stripIndent()
            ]
        ]
    ]

```

How do I achieve this in a declarative pipeline?

Thank you