public UpdateEndpointWeightsAndCapacitiesRequest withDesiredWeightsAndCapacities(DesiredWeightAndCapacity... desiredWeightsAndCapacities) {
        if (this.desiredWeightsAndCapacities == null) {
            setDesiredWeightsAndCapacities(new java.util.ArrayList<DesiredWeightAndCapacity>(desiredWeightsAndCapacities.length));
        }
        for (DesiredWeightAndCapacity ele : desiredWeightsAndCapacities) {
            this.desiredWeightsAndCapacities.add(ele);
        }
        return this;
    }
<p>
An object that provides new capacity and weight values for a variant.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setDesiredWeightsAndCapacities(java.util.Collection)} or
{@link #withDesiredWeightsAndCapacities(java.util.Collection)} if you want to override the existing values.
</p>

@param desiredWeightsAndCapacities
       An object that provides new capacity and weight values for a variant.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/UpdateEndpointWeightsAndCapacitiesRequest.java