public GetMetricDataV2Request withGroupings(String... groupings) {
        if (this.groupings == null) {
            setGroupings(new java.util.ArrayList<String>(groupings.length));
        }
        for (String ele : groupings) {
            this.groupings.add(ele);
        }
        return this;
    }
<p>
The grouping applied to the metrics that are returned. For example, when results are grouped by queue, the
metrics returned are grouped by queue. The values that are returned apply to the metrics for each queue. They are
not aggregated for all queues.
</p>
<p>
If no grouping is specified, a summary of all metrics is returned.
</p>
<p>
Valid grouping keys: <code>AGENT</code> | <code>AGENT_HIERARCHY_LEVEL_ONE</code> |
<code>AGENT_HIERARCHY_LEVEL_TWO</code> | <code>AGENT_HIERARCHY_LEVEL_THREE</code> |
<code>AGENT_HIERARCHY_LEVEL_FOUR</code> | <code>AGENT_HIERARCHY_LEVEL_FIVE</code> |
<code>ANSWERING_MACHINE_DETECTION_STATUS</code> | <code>CAMPAIGN</code> | <code>CASE_TEMPLATE_ARN</code> |
<code>CASE_STATUS</code> | <code>CHANNEL</code> | <code>contact/segmentAttributes/connect:Subtype</code> |
<code>DISCONNECT_REASON</code> | <code>FLOWS_RESOURCE_ID</code> | <code>FLOWS_MODULE_RESOURCE_ID</code> |
<code>FLOW_TYPE</code> | <code>FLOWS_OUTCOME_TYPE</code> | <code>INITIATION_METHOD</code> |
<code>Q_CONNECT_ENABLED</code> | <code>QUEUE</code> | <code>RESOURCE_PUBLISHED_TIMESTAMP</code> |
<code>ROUTING_PROFILE</code> | <code>ROUTING_STEP_EXPRESSION</code>
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setGroupings(java.util.Collection)} or {@link #withGroupings(java.util.Collection)} if you want to
override the existing values.
</p>

@param groupings
       The grouping applied to the metrics that are returned. For example, when results are grouped by queue, the
       metrics returned are grouped by queue. The values that are returned apply to the metrics for each queue.
       They are not aggregated for all queues.</p>
       <p>
       If no grouping is specified, a summary of all metrics is returned.
       </p>
       <p>
       Valid grouping keys: <code>AGENT</code> | <code>AGENT_HIERARCHY_LEVEL_ONE</code> |
       <code>AGENT_HIERARCHY_LEVEL_TWO</code> | <code>AGENT_HIERARCHY_LEVEL_THREE</code> |
       <code>AGENT_HIERARCHY_LEVEL_FOUR</code> | <code>AGENT_HIERARCHY_LEVEL_FIVE</code> |
       <code>ANSWERING_MACHINE_DETECTION_STATUS</code> | <code>CAMPAIGN</code> | <code>CASE_TEMPLATE_ARN</code> |
       <code>CASE_STATUS</code> | <code>CHANNEL</code> | <code>contact/segmentAttributes/connect:Subtype</code> |
       <code>DISCONNECT_REASON</code> | <code>FLOWS_RESOURCE_ID</code> | <code>FLOWS_MODULE_RESOURCE_ID</code> |
       <code>FLOW_TYPE</code> | <code>FLOWS_OUTCOME_TYPE</code> | <code>INITIATION_METHOD</code> |
       <code>Q_CONNECT_ENABLED</code> | <code>QUEUE</code> | <code>RESOURCE_PUBLISHED_TIMESTAMP</code> |
       <code>ROUTING_PROFILE</code> | <code>ROUTING_STEP_EXPRESSION</code>
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-connect/src/main/java/com/amazonaws/services/connect/model/GetMetricDataV2Request.java