File: api_op_GetMetricDataV2.go

package info (click to toggle)
gitaly 16.11.6%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,623,936 kB
  • sloc: cpp: 33,732; java: 20,579; sh: 5,372; cs: 3,973; javascript: 3,426; python: 3,053; makefile: 2,303; ansic: 1,729; php: 1,455; asm: 1,217; xml: 838; ruby: 452; sql: 431; yacc: 22; sed: 1
file content (1194 lines) | stat: -rw-r--r-- 49,475 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
// Code generated by smithy-go-codegen DO NOT EDIT.

package connect

import (
	"context"
	"fmt"
	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
	"github.com/aws/aws-sdk-go-v2/service/connect/types"
	"github.com/aws/smithy-go/middleware"
	smithyhttp "github.com/aws/smithy-go/transport/http"
	"time"
)

// Gets metric data from the specified Amazon Connect instance.
//
// GetMetricDataV2 offers more features than [GetMetricData], the previous version of this API.
// It has new metrics, offers filtering at a metric level, and offers the ability
// to filter and group data by channels, queues, routing profiles, agents, and
// agent hierarchy levels. It can retrieve historical data for the last 3 months,
// at varying intervals.
//
// For a description of the historical metrics that are supported by
// GetMetricDataV2 and GetMetricData , see [Historical metrics definitions] in the Amazon Connect Administrator
// Guide.
//
// [Historical metrics definitions]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html
// [GetMetricData]: https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricData.html
func (c *Client) GetMetricDataV2(ctx context.Context, params *GetMetricDataV2Input, optFns ...func(*Options)) (*GetMetricDataV2Output, error) {
	if params == nil {
		params = &GetMetricDataV2Input{}
	}

	result, metadata, err := c.invokeOperation(ctx, "GetMetricDataV2", params, optFns, c.addOperationGetMetricDataV2Middlewares)
	if err != nil {
		return nil, err
	}

	out := result.(*GetMetricDataV2Output)
	out.ResultMetadata = metadata
	return out, nil
}

type GetMetricDataV2Input struct {

	// The timestamp, in UNIX Epoch time format, at which to end the reporting
	// interval for the retrieval of historical metrics data. The time must be later
	// than the start time timestamp. It cannot be later than the current timestamp.
	//
	// This member is required.
	EndTime *time.Time

	// The filters to apply to returned metrics. You can filter on the following
	// resources:
	//
	//   - Agents
	//
	//   - Channels
	//
	//   - Feature
	//
	//   - Queues
	//
	//   - Routing profiles
	//
	//   - Routing step expression
	//
	//   - User hierarchy groups
	//
	// At least one filter must be passed from queues, routing profiles, agents, or
	// user hierarchy groups.
	//
	// To filter by phone number, see [Create a historical metrics report] in the Amazon Connect Administrator Guide.
	//
	// Note the following limits:
	//
	//   - Filter keys: A maximum of 5 filter keys are supported in a single request.
	//   Valid filter keys: AGENT | AGENT_HIERARCHY_LEVEL_ONE |
	//   AGENT_HIERARCHY_LEVEL_TWO | AGENT_HIERARCHY_LEVEL_THREE |
	//   AGENT_HIERARCHY_LEVEL_FOUR | AGENT_HIERARCHY_LEVEL_FIVE | CASE_TEMPLATE_ARN |
	//   CASE_STATUS | CHANNEL | contact/segmentAttributes/connect:Subtype | FEATURE |
	//   FLOW_TYPE | FLOWS_NEXT_RESOURCE_ID | FLOWS_NEXT_RESOURCE_QUEUE_ID |
	//   FLOWS_OUTCOME_TYPE | FLOWS_RESOURCE_ID | INITIATION_METHOD |
	//   RESOURCE_PUBLISHED_TIMESTAMP | ROUTING_PROFILE | ROUTING_STEP_EXPRESSION |
	//   QUEUE | Q_CONNECT_ENABLED |
	//
	//   - Filter values: A maximum of 100 filter values are supported in a single
	//   request. VOICE, CHAT, and TASK are valid filterValue for the CHANNEL filter
	//   key. They do not count towards limitation of 100 filter values. For example, a
	//   GetMetricDataV2 request can filter by 50 queues, 35 agents, and 15 routing
	//   profiles for a total of 100 filter values, along with 3 channel filters.
	//
	// contact_lens_conversational_analytics is a valid filterValue for the FEATURE
	//   filter key. It is available only to contacts analyzed by Contact Lens
	//   conversational analytics.
	//
	// connect:Chat , connect:SMS , connect:Telephony , and connect:WebRTC are valid
	//   filterValue examples (not exhaustive) for the
	//   contact/segmentAttributes/connect:Subtype filter key.
	//
	// ROUTING_STEP_EXPRESSION is a valid filter key with a filter value up to 3000
	//   length. This filter is case and order sensitive. JSON string fields must be
	//   sorted in ascending order and JSON array order should be kept as is.
	//
	// Q_CONNECT_ENABLED . TRUE and FALSE are the only valid filterValues for the
	//   Q_CONNECT_ENABLED filter key.
	//
	//   - TRUE includes all contacts that had Amazon Q in Connect enabled as part of
	//   the flow.
	//
	//   - FALSE includes all contacts that did not have Amazon Q in Connect enabled
	//   as part of the flow
	//
	// This filter is available only for contact record-driven metrics.
	//
	// [Create a historical metrics report]: https://docs.aws.amazon.com/connect/latest/adminguide/create-historical-metrics-report.html
	//
	// This member is required.
	Filters []types.FilterV2

	// The metrics to retrieve. Specify the name, groupings, and filters for each
	// metric. The following historical metrics are available. For a description of
	// each metric, see [Historical metrics definitions]in the Amazon Connect Administrator Guide.
	//
	// ABANDONMENT_RATE Unit: Percent
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Abandonment rate]
	//
	// AGENT_ADHERENT_TIME This metric is available only in Amazon Web Services
	// Regions where [Forecasting, capacity planning, and scheduling]is available.
	//
	// Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// UI name: [Adherent time]
	//
	// AGENT_ANSWER_RATE Unit: Percent
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// UI name: [Agent answer rate]
	//
	// AGENT_NON_ADHERENT_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// UI name: [Non-adherent time]
	//
	// AGENT_NON_RESPONSE Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// UI name: [Agent non-response]
	//
	// AGENT_NON_RESPONSE_WITHOUT_CUSTOMER_ABANDONS Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// Data for this metric is available starting from October 1, 2023 0:00:00 GMT.
	//
	// UI name: [Agent non-response without customer abandons]
	//
	// AGENT_OCCUPANCY Unit: Percentage
	//
	// Valid groupings and filters: Routing Profile, Agent, Agent Hierarchy
	//
	// UI name: [Occupancy]
	//
	// AGENT_SCHEDULE_ADHERENCE This metric is available only in Amazon Web Services
	// Regions where [Forecasting, capacity planning, and scheduling]is available.
	//
	// Unit: Percent
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// UI name: [Adherence]
	//
	// AGENT_SCHEDULED_TIME This metric is available only in Amazon Web Services
	// Regions where [Forecasting, capacity planning, and scheduling]is available.
	//
	// Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// UI name: [Scheduled time]
	//
	// AVG_ABANDON_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average queue abandon time]
	//
	// AVG_ACTIVE_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [Average active time]
	//
	// AVG_AFTER_CONTACT_WORK_TIME Unit: Seconds
	//
	// Valid metric filter key: INITIATION_METHOD
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average after contact work time]
	//
	// Feature is a valid filter but not a valid grouping.
	//
	// AVG_AGENT_CONNECTING_TIME Unit: Seconds
	//
	// Valid metric filter key: INITIATION_METHOD . For now, this metric only supports
	// the following as INITIATION_METHOD : INBOUND | OUTBOUND | CALLBACK | API
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// UI name: [Average agent API connecting time]
	//
	// The Negate key in Metric Level Filters is not applicable for this metric.
	//
	// AVG_AGENT_PAUSE_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [Average agent pause time]
	//
	// AVG_CASE_RELATED_CONTACTS Unit: Count
	//
	// Required filter key: CASE_TEMPLATE_ARN
	//
	// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS
	//
	// UI name: [Average contacts per case]
	//
	// AVG_CASE_RESOLUTION_TIME Unit: Seconds
	//
	// Required filter key: CASE_TEMPLATE_ARN
	//
	// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS
	//
	// UI name: [Average case resolution time]
	//
	// AVG_CONTACT_DURATION Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average contact duration]
	//
	// Feature is a valid filter but not a valid grouping.
	//
	// AVG_CONVERSATION_DURATION Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average conversation duration]
	//
	// AVG_FLOW_TIME Unit: Seconds
	//
	// Valid groupings and filters: Channel,
	// contact/segmentAttributes/connect:Subtype, Flow type, Flows module resource ID,
	// Flows next resource ID, Flows next resource queue ID, Flows outcome type, Flows
	// resource ID, Initiation method, Resource published timestamp
	//
	// UI name: [Average flow time]
	//
	// AVG_GREETING_TIME_AGENT This metric is available only for contacts analyzed by
	// Contact Lens conversational analytics.
	//
	// Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average agent greeting time]
	//
	// AVG_HANDLE_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype,
	// RoutingStepExpression
	//
	// UI name: [Average handle time]
	//
	// Feature is a valid filter but not a valid grouping.
	//
	// AVG_HOLD_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average customer hold time]
	//
	// Feature is a valid filter but not a valid grouping.
	//
	// AVG_HOLD_TIME_ALL_CONTACTS Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average customer hold time all contacts]
	//
	// AVG_HOLDS Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average holds]
	//
	// Feature is a valid filter but not a valid grouping.
	//
	// AVG_INTERACTION_AND_HOLD_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average agent interaction and customer hold time]
	//
	// AVG_INTERACTION_TIME Unit: Seconds
	//
	// Valid metric filter key: INITIATION_METHOD
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Feature,
	// contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average agent interaction time]
	//
	// Feature is a valid filter but not a valid grouping.
	//
	// AVG_INTERRUPTIONS_AGENT This metric is available only for contacts analyzed by
	// Contact Lens conversational analytics.
	//
	// Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average agent interruptions]
	//
	// AVG_INTERRUPTION_TIME_AGENT This metric is available only for contacts analyzed
	// by Contact Lens conversational analytics.
	//
	// Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average agent interruption time]
	//
	// AVG_NON_TALK_TIME This metric is available only for contacts analyzed by
	// Contact Lens conversational analytics.
	//
	// Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average non-talk time]
	//
	// AVG_QUEUE_ANSWER_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Feature,
	// contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average queue answer time]
	//
	// Feature is a valid filter but not a valid grouping.
	//
	// AVG_RESOLUTION_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile,
	// contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average resolution time]
	//
	// AVG_TALK_TIME This metric is available only for contacts analyzed by Contact
	// Lens conversational analytics.
	//
	// Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average talk time]
	//
	// AVG_TALK_TIME_AGENT This metric is available only for contacts analyzed by
	// Contact Lens conversational analytics.
	//
	// Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average agent talk time]
	//
	// AVG_TALK_TIME_CUSTOMER This metric is available only for contacts analyzed by
	// Contact Lens conversational analytics.
	//
	// Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Average customer talk time]
	//
	// CASES_CREATED Unit: Count
	//
	// Required filter key: CASE_TEMPLATE_ARN
	//
	// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS
	//
	// UI name: [Cases created]
	//
	// CONTACTS_ABANDONED Unit: Count
	//
	// Metric filter:
	//
	//   - Valid values: API | Incoming | Outbound | Transfer | Callback |
	//   Queue_Transfer | Disconnect
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, RoutingStepExpression, Q
	// in Connect
	//
	// UI name: [Contact abandoned]
	//
	// CONTACTS_ABANDONED_IN_X Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile,
	// contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// Threshold: For ThresholdValue , enter any whole number from 1 to 604800
	// (inclusive), in seconds. For Comparison , you must enter LT (for "Less than").
	//
	// UI name: [Contacts abandoned in X seconds]
	//
	// CONTACTS_ANSWERED_IN_X Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile,
	// contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// Threshold: For ThresholdValue , enter any whole number from 1 to 604800
	// (inclusive), in seconds. For Comparison , you must enter LT (for "Less than").
	//
	// UI name: [Contacts answered in X seconds]
	//
	// CONTACTS_CREATED Unit: Count
	//
	// Valid metric filter key: INITIATION_METHOD
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Feature,
	// contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Contacts created]
	//
	// Feature is a valid filter but not a valid grouping.
	//
	// CONTACTS_HANDLED Unit: Count
	//
	// Valid metric filter key: INITIATION_METHOD , DISCONNECT_REASON
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype,
	// RoutingStepExpression, Q in Connect
	//
	// UI name: [API contacts handled]
	//
	// Feature is a valid filter but not a valid grouping.
	//
	// CONTACTS_HANDLED_BY_CONNECTED_TO_AGENT Unit: Count
	//
	// Valid metric filter key: INITIATION_METHOD
	//
	// Valid groupings and filters: Queue, Channel, Agent, Agent Hierarchy,
	// contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Contacts handled (connected to agent timestamp)]
	//
	// CONTACTS_HOLD_ABANDONS Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Contacts hold disconnect]
	//
	// CONTACTS_ON_HOLD_AGENT_DISCONNECT Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [Contacts hold agent disconnect]
	//
	// CONTACTS_ON_HOLD_CUSTOMER_DISCONNECT Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [Contacts hold customer disconnect]
	//
	// CONTACTS_PUT_ON_HOLD Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [Contacts put on hold]
	//
	// CONTACTS_TRANSFERRED_OUT_EXTERNAL Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [Contacts transferred out external]
	//
	// CONTACTS_TRANSFERRED_OUT_INTERNAL Unit: Percent
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [Contacts transferred out internal]
	//
	// CONTACTS_QUEUED Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Contacts queued]
	//
	// CONTACTS_QUEUED_BY_ENQUEUE Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Agent, Agent Hierarchy,
	// contact/segmentAttributes/connect:Subtype
	//
	// UI name: [Contacts queued (enqueue timestamp)]
	//
	// CONTACTS_RESOLVED_IN_X Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile,
	// contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// Threshold: For ThresholdValue enter any whole number from 1 to 604800
	// (inclusive), in seconds. For Comparison , you must enter LT (for "Less than").
	//
	// UI name: [Contacts resolved in X]
	//
	// CONTACTS_TRANSFERRED_OUT Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Contacts transferred out]
	//
	// Feature is a valid filter but not a valid grouping.
	//
	// CONTACTS_TRANSFERRED_OUT_BY_AGENT Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Contacts transferred out by agent]
	//
	// CONTACTS_TRANSFERRED_OUT_FROM_QUEUE Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Contacts transferred out queue]
	//
	// CURRENT_CASES Unit: Count
	//
	// Required filter key: CASE_TEMPLATE_ARN
	//
	// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS
	//
	// UI name: [Current cases]
	//
	// FLOWS_OUTCOME Unit: Count
	//
	// Valid groupings and filters: Channel,
	// contact/segmentAttributes/connect:Subtype, Flow type, Flows module resource ID,
	// Flows next resource ID, Flows next resource queue ID, Flows outcome type, Flows
	// resource ID, Initiation method, Resource published timestamp
	//
	// UI name: [Flows outcome]
	//
	// FLOWS_STARTED Unit: Count
	//
	// Valid groupings and filters: Channel,
	// contact/segmentAttributes/connect:Subtype, Flow type, Flows module resource ID,
	// Flows resource ID, Initiation method, Resource published timestamp
	//
	// UI name: [Flows started]
	//
	// MAX_FLOW_TIME Unit: Seconds
	//
	// Valid groupings and filters: Channel,
	// contact/segmentAttributes/connect:Subtype, Flow type, Flows module resource ID,
	// Flows next resource ID, Flows next resource queue ID, Flows outcome type, Flows
	// resource ID, Initiation method, Resource published timestamp
	//
	// UI name: [Maximum flow time]
	//
	// MAX_QUEUED_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Maximum queued time]
	//
	// MIN_FLOW_TIME Unit: Seconds
	//
	// Valid groupings and filters: Channel,
	// contact/segmentAttributes/connect:Subtype, Flow type, Flows module resource ID,
	// Flows next resource ID, Flows next resource queue ID, Flows outcome type, Flows
	// resource ID, Initiation method, Resource published timestamp
	//
	// UI name: [Minimum flow time]
	//
	// PERCENT_CASES_FIRST_CONTACT_RESOLVED Unit: Percent
	//
	// Required filter key: CASE_TEMPLATE_ARN
	//
	// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS
	//
	// UI name: [Cases resolved on first contact]
	//
	// PERCENT_CONTACTS_STEP_EXPIRED Unit: Percent
	//
	// Valid groupings and filters: Queue, RoutingStepExpression
	//
	// UI name: Not available
	//
	// PERCENT_CONTACTS_STEP_JOINED Unit: Percent
	//
	// Valid groupings and filters: Queue, RoutingStepExpression
	//
	// UI name: Not available
	//
	// PERCENT_FLOWS_OUTCOME Unit: Percent
	//
	// Valid metric filter key: FLOWS_OUTCOME_TYPE
	//
	// Valid groupings and filters: Channel,
	// contact/segmentAttributes/connect:Subtype, Flow type, Flows module resource ID,
	// Flows next resource ID, Flows next resource queue ID, Flows outcome type, Flows
	// resource ID, Initiation method, Resource published timestamp
	//
	// UI name: [Flows outcome percentage].
	//
	// The FLOWS_OUTCOME_TYPE is not a valid grouping.
	//
	// PERCENT_NON_TALK_TIME This metric is available only for contacts analyzed by
	// Contact Lens conversational analytics.
	//
	// Unit: Percentage
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Non-talk time percent]
	//
	// PERCENT_TALK_TIME This metric is available only for contacts analyzed by
	// Contact Lens conversational analytics.
	//
	// Unit: Percentage
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Talk time percent]
	//
	// PERCENT_TALK_TIME_AGENT This metric is available only for contacts analyzed by
	// Contact Lens conversational analytics.
	//
	// Unit: Percentage
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Agent talk time percent]
	//
	// PERCENT_TALK_TIME_CUSTOMER This metric is available only for contacts analyzed
	// by Contact Lens conversational analytics.
	//
	// Unit: Percentage
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Customer talk time percent]
	//
	// REOPENED_CASE_ACTIONS Unit: Count
	//
	// Required filter key: CASE_TEMPLATE_ARN
	//
	// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS
	//
	// UI name: [Cases reopened]
	//
	// RESOLVED_CASE_ACTIONS Unit: Count
	//
	// Required filter key: CASE_TEMPLATE_ARN
	//
	// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS
	//
	// UI name: [Cases resolved]
	//
	// SERVICE_LEVEL You can include up to 20 SERVICE_LEVEL metrics in a request.
	//
	// Unit: Percent
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Q in Connect
	//
	// Threshold: For ThresholdValue , enter any whole number from 1 to 604800
	// (inclusive), in seconds. For Comparison , you must enter LT (for "Less than").
	//
	// UI name: [Service level X]
	//
	// STEP_CONTACTS_QUEUED Unit: Count
	//
	// Valid groupings and filters: Queue, RoutingStepExpression
	//
	// UI name: Not available
	//
	// SUM_AFTER_CONTACT_WORK_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [After contact work time]
	//
	// SUM_CONNECTING_TIME_AGENT Unit: Seconds
	//
	// Valid metric filter key: INITIATION_METHOD . This metric only supports the
	// following filter keys as INITIATION_METHOD : INBOUND | OUTBOUND | CALLBACK | API
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// UI name: [Agent API connecting time]
	//
	// The Negate key in Metric Level Filters is not applicable for this metric.
	//
	// SUM_CONTACT_FLOW_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [Contact flow time]
	//
	// SUM_CONTACT_TIME_AGENT Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// UI name: [Agent on contact time]
	//
	// SUM_CONTACTS_DISCONNECTED Valid metric filter key: DISCONNECT_REASON
	//
	// Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Contact disconnected]
	//
	// SUM_ERROR_STATUS_TIME_AGENT Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// UI name: [Error status time]
	//
	// SUM_HANDLE_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [Contact handle time]
	//
	// SUM_HOLD_TIME Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [Customer hold time]
	//
	// SUM_IDLE_TIME_AGENT Unit: Seconds
	//
	// Valid groupings and filters: Routing Profile, Agent, Agent Hierarchy
	//
	// UI name: [Agent idle time]
	//
	// SUM_INTERACTION_AND_HOLD_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy, Q in Connect
	//
	// UI name: [Agent interaction and hold time]
	//
	// SUM_INTERACTION_TIME Unit: Seconds
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent
	// Hierarchy
	//
	// UI name: [Agent interaction time]
	//
	// SUM_NON_PRODUCTIVE_TIME_AGENT Unit: Seconds
	//
	// Valid groupings and filters: Routing Profile, Agent, Agent Hierarchy
	//
	// UI name: [Non-Productive Time]
	//
	// SUM_ONLINE_TIME_AGENT Unit: Seconds
	//
	// Valid groupings and filters: Routing Profile, Agent, Agent Hierarchy
	//
	// UI name: [Online time]
	//
	// SUM_RETRY_CALLBACK_ATTEMPTS Unit: Count
	//
	// Valid groupings and filters: Queue, Channel, Routing Profile,
	// contact/segmentAttributes/connect:Subtype, Q in Connect
	//
	// UI name: [Callback attempts]
	//
	// [Historical metrics definitions]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html
	// [Contacts transferred out external]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-transferred-out-external-historical
	// [Average agent greeting time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-greeting-time-agent-historical
	// [Non-talk time percent]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#ntt-historical
	// [Average agent pause time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-agent-pause-time-historical
	// [Average queue abandon time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-queue-abandon-time-historical
	// [Contacts transferred out by agent]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-transferred-out-by-agent-historical
	// [Average agent API connecting time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#htm-avg-agent-api-connecting-time
	// [Maximum flow time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#maximum-flow-time-historical
	// [Average contact duration]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-contact-duration-historical
	// [Non-adherent time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#non-adherent-time
	// [Average agent interaction and customer hold time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-agent-interaction-customer-hold-time-historical
	// [Contacts created]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-created-historical
	// [Adherence]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#adherence-historical
	// [Customer talk time percent]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#ttcustomer-historical
	// [Average conversation duration]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-conversation-duration-historical
	// [After contact work time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#acw-historical
	// [Average customer talk time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-talk-time-customer-historical
	// [Flows outcome]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#flows-outcome-historical
	// [Contacts queued]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-queued-historical
	// [Occupancy]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#occupancy-historical
	// [Error status time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#error-status-time-historical
	// [Maximum queued time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#maximum-queued-time-historical
	// [Contacts answered in X seconds]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-answered-x-historical
	// [Minimum flow time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#minimum-flow-time-historical
	// [Average active time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-active-time-historical
	// [Contacts transferred out queue]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-transferred-out-by-agent-historical
	// [Cases reopened]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#cases-reopened-historical
	// [Average case resolution time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-case-resolution-time-historical
	// [Contact flow time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contact-flow-time-historical
	// [Average customer hold time all contacts]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#avg-customer-hold-time-all-contacts-historical
	// [Agent API connecting time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#htm-agent-api-connecting-time
	// [Average agent interaction time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-agent-interaction-time-historical
	// [Talk time percent]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#tt-historical
	// [Agent on contact time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#agent-on-contact-time-historical
	// [Average non-talk time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html##average-non-talk-time-historical
	// [Average agent talk time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-talk-time-agent-historical
	// [Flows started]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#flows-started-historical
	// [Average agent interruption time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-interruptions-time-agent-historical
	// [Contacts transferred out]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-transferred-out-historical
	// [Average contacts per case]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-contacts-case-historical
	// [Agent talk time percent]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#ttagent-historical
	// [Average resolution time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-resolution-time-historical
	// [Flows outcome percentage]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#flows-outcome-percentage-historical
	// [Cases resolved]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#cases-resolved-historicall
	// [Contacts queued (enqueue timestamp)]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-queued-by-enqueue-historical
	// [Average flow time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-flow-time-historical
	// [Contacts hold disconnect]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-handled-by-connected-to-agent-historical
	// [Online time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#online-time-historical
	// [Average holds]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-holds-historical
	// [API contacts handled]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#api-contacts-handled-historical
	// [Agent interaction time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#agent-interaction-time-historical
	// [Agent non-response without customer abandons]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#agent-nonresponse-no-abandon-historical
	// [Average agent interruptions]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-interruptions-agent-historical
	// [Service level X]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#service-level-historical
	// [Contact handle time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contact-handle-time-historical
	// [Contact disconnected]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contact-disconnected-historical
	// [Contacts handled (connected to agent timestamp)]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-handled-by-connected-to-agent-historical
	// [Agent idle time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#agent-idle-time-historica
	// [Contacts resolved in X]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-resolved-historical
	// [Contact abandoned]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-abandoned-historical
	// [Cases resolved on first contact]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#cases-resolved-first-contact-historical
	// [Adherent time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#adherent-time-historical
	// [Abandonment rate]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#abandonment-rate-historical
	// [Average talk time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-talk-time-historical
	// [Scheduled time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#scheduled-time-historical
	// [Average after contact work time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-acw-time-historical
	// [Contacts abandoned in X seconds]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-abandoned-x-historical
	// [Non-Productive Time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#npt-historical
	// [Cases created]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html##cases-created-historical
	// [Current cases]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#current-cases-historical
	// [Average queue answer time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-queue-answer-time-historical
	// [Customer hold time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#customer-hold-time-historical
	// [Average handle time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-handle-time-historical
	// [Average customer hold time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#average-customer-hold-time-historical
	// [Agent interaction and hold time]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#agent-interaction-hold-time-historical
	// [Contacts hold customer disconnect]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-hold-customer-disconnect-historical
	// [Contacts put on hold]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-hold-customer-disconnect-historical
	// [Contacts hold agent disconnect]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-hold-agent-disconnect-historical
	// [Contacts transferred out internal]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#contacts-transferred-out-internal-historical
	// [Agent non-response]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#agent-non-response
	// [Callback attempts]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#callback-attempts-historical
	// [Forecasting, capacity planning, and scheduling]: https://docs.aws.amazon.com/connect/latest/adminguide/regions.html#optimization_region
	// [Agent answer rate]: https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html#agent-answer-rate-historical
	//
	// This member is required.
	Metrics []types.MetricV2

	// The Amazon Resource Name (ARN) of the resource. This includes the instanceId an
	// Amazon Connect instance.
	//
	// This member is required.
	ResourceArn *string

	// The timestamp, in UNIX Epoch time format, at which to start the reporting
	// interval for the retrieval of historical metrics data. The time must be before
	// the end time timestamp. The start and end time depends on the IntervalPeriod
	// selected. By default the time range between start and end time is 35 days.
	// Historical metrics are available for 3 months.
	//
	// This member is required.
	StartTime *time.Time

	// 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.
	//
	// If no grouping is specified, a summary of all metrics is returned.
	//
	// Valid grouping keys: AGENT | AGENT_HIERARCHY_LEVEL_ONE |
	// AGENT_HIERARCHY_LEVEL_TWO | AGENT_HIERARCHY_LEVEL_THREE |
	// AGENT_HIERARCHY_LEVEL_FOUR | AGENT_HIERARCHY_LEVEL_FIVE | CASE_TEMPLATE_ARN |
	// CASE_STATUS | CHANNEL | contact/segmentAttributes/connect:Subtype |
	// FLOWS_RESOURCE_ID | FLOWS_MODULE_RESOURCE_ID | FLOW_TYPE | FLOWS_OUTCOME_TYPE |
	// INITIATION_METHOD | Q_CONNECT_ENABLED | QUEUE | RESOURCE_PUBLISHED_TIMESTAMP |
	// ROUTING_PROFILE | ROUTING_STEP_EXPRESSION
	Groupings []string

	// The interval period and timezone to apply to returned metrics.
	//
	//   - IntervalPeriod : An aggregated grouping applied to request metrics. Valid
	//   IntervalPeriod values are: FIFTEEN_MIN | THIRTY_MIN | HOUR | DAY | WEEK |
	//   TOTAL .
	//
	// For example, if IntervalPeriod is selected THIRTY_MIN , StartTime and EndTime
	//   differs by 1 day, then Amazon Connect returns 48 results in the response. Each
	//   result is aggregated by the THIRTY_MIN period. By default Amazon Connect
	//   aggregates results based on the TOTAL interval period.
	//
	// The following list describes restrictions on StartTime and EndTime based on
	//   which IntervalPeriod is requested.
	//
	//   - FIFTEEN_MIN : The difference between StartTime and EndTime must be less than
	//   3 days.
	//
	//   - THIRTY_MIN : The difference between StartTime and EndTime must be less than
	//   3 days.
	//
	//   - HOUR : The difference between StartTime and EndTime must be less than 3 days.
	//
	//   - DAY : The difference between StartTime and EndTime must be less than 35 days.
	//
	//   - WEEK : The difference between StartTime and EndTime must be less than 35
	//   days.
	//
	//   - TOTAL : The difference between StartTime and EndTime must be less than 35
	//   days.
	//
	//   - TimeZone : The timezone applied to requested metrics.
	Interval *types.IntervalDetails

	// The maximum number of results to return per page.
	MaxResults *int32

	// The token for the next set of results. Use the value returned in the previous
	// response in the next request to retrieve the next set of results.
	NextToken *string

	noSmithyDocumentSerde
}

type GetMetricDataV2Output struct {

	// Information about the metrics requested in the API request If no grouping is
	// specified, a summary of metric data is returned.
	MetricResults []types.MetricResultV2

	// If there are additional results, this is the token for the next set of results.
	NextToken *string

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata

	noSmithyDocumentSerde
}

func (c *Client) addOperationGetMetricDataV2Middlewares(stack *middleware.Stack, options Options) (err error) {
	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
		return err
	}
	err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMetricDataV2{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMetricDataV2{}, middleware.After)
	if err != nil {
		return err
	}
	if err := addProtocolFinalizerMiddlewares(stack, options, "GetMetricDataV2"); err != nil {
		return fmt.Errorf("add protocol finalizers: %v", err)
	}

	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
		return err
	}
	if err = addSetLoggerMiddleware(stack, options); err != nil {
		return err
	}
	if err = addClientRequestID(stack); err != nil {
		return err
	}
	if err = addComputeContentLength(stack); err != nil {
		return err
	}
	if err = addResolveEndpointMiddleware(stack, options); err != nil {
		return err
	}
	if err = addComputePayloadSHA256(stack); err != nil {
		return err
	}
	if err = addRetry(stack, options); err != nil {
		return err
	}
	if err = addRawResponseToMetadata(stack); err != nil {
		return err
	}
	if err = addRecordResponseTiming(stack); err != nil {
		return err
	}
	if err = addClientUserAgent(stack, options); err != nil {
		return err
	}
	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
		return err
	}
	if err = addOpGetMetricDataV2ValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMetricDataV2(options.Region), middleware.Before); err != nil {
		return err
	}
	if err = addRecursionDetection(stack); err != nil {
		return err
	}
	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
		return err
	}
	if err = addResponseErrorMiddleware(stack); err != nil {
		return err
	}
	if err = addRequestResponseLogging(stack, options); err != nil {
		return err
	}
	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
		return err
	}
	return nil
}

// GetMetricDataV2APIClient is a client that implements the GetMetricDataV2
// operation.
type GetMetricDataV2APIClient interface {
	GetMetricDataV2(context.Context, *GetMetricDataV2Input, ...func(*Options)) (*GetMetricDataV2Output, error)
}

var _ GetMetricDataV2APIClient = (*Client)(nil)

// GetMetricDataV2PaginatorOptions is the paginator options for GetMetricDataV2
type GetMetricDataV2PaginatorOptions struct {
	// The maximum number of results to return per page.
	Limit int32

	// Set to true if pagination should stop if the service returns a pagination token
	// that matches the most recent token provided to the service.
	StopOnDuplicateToken bool
}

// GetMetricDataV2Paginator is a paginator for GetMetricDataV2
type GetMetricDataV2Paginator struct {
	options   GetMetricDataV2PaginatorOptions
	client    GetMetricDataV2APIClient
	params    *GetMetricDataV2Input
	nextToken *string
	firstPage bool
}

// NewGetMetricDataV2Paginator returns a new GetMetricDataV2Paginator
func NewGetMetricDataV2Paginator(client GetMetricDataV2APIClient, params *GetMetricDataV2Input, optFns ...func(*GetMetricDataV2PaginatorOptions)) *GetMetricDataV2Paginator {
	if params == nil {
		params = &GetMetricDataV2Input{}
	}

	options := GetMetricDataV2PaginatorOptions{}
	if params.MaxResults != nil {
		options.Limit = *params.MaxResults
	}

	for _, fn := range optFns {
		fn(&options)
	}

	return &GetMetricDataV2Paginator{
		options:   options,
		client:    client,
		params:    params,
		firstPage: true,
		nextToken: params.NextToken,
	}
}

// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetMetricDataV2Paginator) HasMorePages() bool {
	return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}

// NextPage retrieves the next GetMetricDataV2 page.
func (p *GetMetricDataV2Paginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMetricDataV2Output, error) {
	if !p.HasMorePages() {
		return nil, fmt.Errorf("no more pages available")
	}

	params := *p.params
	params.NextToken = p.nextToken

	var limit *int32
	if p.options.Limit > 0 {
		limit = &p.options.Limit
	}
	params.MaxResults = limit

	result, err := p.client.GetMetricDataV2(ctx, &params, optFns...)
	if err != nil {
		return nil, err
	}
	p.firstPage = false

	prevToken := p.nextToken
	p.nextToken = result.NextToken

	if p.options.StopOnDuplicateToken &&
		prevToken != nil &&
		p.nextToken != nil &&
		*prevToken == *p.nextToken {
		p.nextToken = nil
	}

	return result, nil
}

func newServiceMetadataMiddleware_opGetMetricDataV2(region string) *awsmiddleware.RegisterServiceMetadata {
	return &awsmiddleware.RegisterServiceMetadata{
		Region:        region,
		ServiceID:     ServiceID,
		OperationName: "GetMetricDataV2",
	}
}