public CreateSecurityProfileRequest withAdditionalMetricsToRetainV2(java.util.Collection<MetricToRetain> additionalMetricsToRetainV2) {
        setAdditionalMetricsToRetainV2(additionalMetricsToRetainV2);
        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>

@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