public CreateSecurityProfileRequest withAdditionalMetricsToRetainV2(MetricToRetain... additionalMetricsToRetainV2) {
        if (this.additionalMetricsToRetainV2 == null) {
            setAdditionalMetricsToRetainV2(new java.util.ArrayList<MetricToRetain>(additionalMetricsToRetainV2.length));
        }
        for (MetricToRetain ele : additionalMetricsToRetainV2) {
            this.additionalMetricsToRetainV2.add(ele);
        }
        return this;
    }
<p>
A list of metrics whose data is retained (stored). By default, data is retained for any metric used in the
profile's <code>behaviors</code>, but it is also retained for any metric specified here. Can be used with custom
metrics; cannot be used with dimensions.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setAdditionalMetricsToRetainV2(java.util.Collection)} or
{@link #withAdditionalMetricsToRetainV2(java.util.Collection)} if you want to override the existing values.
</p>

@param additionalMetricsToRetainV2
       A list of metrics whose data is retained (stored). By default, data is retained for any metric used in the
       profile's <code>behaviors</code>, but it is also retained for any metric specified here. Can be used with
       custom metrics; cannot be used with dimensions.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateSecurityProfileRequest.java