public CreatePromptRequest withVariants(PromptVariant... variants) {
        if (this.variants == null) {
            setVariants(new java.util.ArrayList<PromptVariant>(variants.length));
        }
        for (PromptVariant ele : variants) {
            this.variants.add(ele);
        }
        return this;
    }
<p>
A list of objects, each containing details about a variant of the prompt.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setVariants(java.util.Collection)} or {@link #withVariants(java.util.Collection)} if you want to override
the existing values.
</p>

@param variants
       A list of objects, each containing details about a variant of the prompt.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-bedrockagent/src/main/java/com/amazonaws/services/bedrockagent/model/CreatePromptRequest.java