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 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A time-ordered series of data points, corresponding to a dimension of a Performance Insights
/// metric.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricKeyDataPoints {
/// <p>The dimension(s) to which the data points apply.</p>
pub key: std::option::Option<crate::model::ResponseResourceMetricKey>,
/// <p>An array of timestamp-value pairs, representing measurements over a period of time.</p>
pub data_points: std::option::Option<std::vec::Vec<crate::model::DataPoint>>,
}
impl std::fmt::Debug for MetricKeyDataPoints {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricKeyDataPoints");
formatter.field("key", &self.key);
formatter.field("data_points", &self.data_points);
formatter.finish()
}
}
/// See [`MetricKeyDataPoints`](crate::model::MetricKeyDataPoints)
pub mod metric_key_data_points {
/// A builder for [`MetricKeyDataPoints`](crate::model::MetricKeyDataPoints)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) key: std::option::Option<crate::model::ResponseResourceMetricKey>,
pub(crate) data_points: std::option::Option<std::vec::Vec<crate::model::DataPoint>>,
}
impl Builder {
/// <p>The dimension(s) to which the data points apply.</p>
pub fn key(mut self, input: crate::model::ResponseResourceMetricKey) -> Self {
self.key = Some(input);
self
}
/// <p>The dimension(s) to which the data points apply.</p>
pub fn set_key(
mut self,
input: std::option::Option<crate::model::ResponseResourceMetricKey>,
) -> Self {
self.key = input;
self
}
/// Appends an item to `data_points`.
///
/// To override the contents of this collection use [`set_data_points`](Self::set_data_points).
///
/// <p>An array of timestamp-value pairs, representing measurements over a period of time.</p>
pub fn data_points(mut self, input: impl Into<crate::model::DataPoint>) -> Self {
let mut v = self.data_points.unwrap_or_default();
v.push(input.into());
self.data_points = Some(v);
self
}
/// <p>An array of timestamp-value pairs, representing measurements over a period of time.</p>
pub fn set_data_points(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::DataPoint>>,
) -> Self {
self.data_points = input;
self
}
/// Consumes the builder and constructs a [`MetricKeyDataPoints`](crate::model::MetricKeyDataPoints)
pub fn build(self) -> crate::model::MetricKeyDataPoints {
crate::model::MetricKeyDataPoints {
key: self.key,
data_points: self.data_points,
}
}
}
}
impl MetricKeyDataPoints {
/// Creates a new builder-style object to manufacture [`MetricKeyDataPoints`](crate::model::MetricKeyDataPoints)
pub fn builder() -> crate::model::metric_key_data_points::Builder {
crate::model::metric_key_data_points::Builder::default()
}
}
/// <p>A timestamp, and a single numerical value, which together represent a measurement at a particular point in time.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DataPoint {
/// <p>The time, in epoch format, associated with a particular <code>Value</code>.</p>
pub timestamp: std::option::Option<aws_smithy_types::Instant>,
/// <p>The actual value associated with a particular <code>Timestamp</code>.</p>
pub value: std::option::Option<f64>,
}
impl std::fmt::Debug for DataPoint {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DataPoint");
formatter.field("timestamp", &self.timestamp);
formatter.field("value", &self.value);
formatter.finish()
}
}
/// See [`DataPoint`](crate::model::DataPoint)
pub mod data_point {
/// A builder for [`DataPoint`](crate::model::DataPoint)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) timestamp: std::option::Option<aws_smithy_types::Instant>,
pub(crate) value: std::option::Option<f64>,
}
impl Builder {
/// <p>The time, in epoch format, associated with a particular <code>Value</code>.</p>
pub fn timestamp(mut self, input: aws_smithy_types::Instant) -> Self {
self.timestamp = Some(input);
self
}
/// <p>The time, in epoch format, associated with a particular <code>Value</code>.</p>
pub fn set_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::Instant>,
) -> Self {
self.timestamp = input;
self
}
/// <p>The actual value associated with a particular <code>Timestamp</code>.</p>
pub fn value(mut self, input: f64) -> Self {
self.value = Some(input);
self
}
/// <p>The actual value associated with a particular <code>Timestamp</code>.</p>
pub fn set_value(mut self, input: std::option::Option<f64>) -> Self {
self.value = input;
self
}
/// Consumes the builder and constructs a [`DataPoint`](crate::model::DataPoint)
pub fn build(self) -> crate::model::DataPoint {
crate::model::DataPoint {
timestamp: self.timestamp,
value: self.value,
}
}
}
}
impl DataPoint {
/// Creates a new builder-style object to manufacture [`DataPoint`](crate::model::DataPoint)
pub fn builder() -> crate::model::data_point::Builder {
crate::model::data_point::Builder::default()
}
}
/// <p>An object describing a Performance Insights metric and one or more dimensions for that metric.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ResponseResourceMetricKey {
/// <p>The name of a Performance Insights metric to be measured.</p>
/// <p>Valid values for <code>Metric</code> are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db.load.avg</code> - a scaled representation of the number of active sessions
/// for the database engine.</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sampledload.avg</code> - the raw number of active sessions for the
/// database engine.</p>
/// </li>
/// </ul>
/// <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code>
/// are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code>
/// showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>.
/// For most use cases, you can query <code>db.load.avg</code> only. </p>
pub metric: std::option::Option<std::string::String>,
/// <p>The valid dimensions for the metric.</p>
pub dimensions:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl std::fmt::Debug for ResponseResourceMetricKey {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ResponseResourceMetricKey");
formatter.field("metric", &self.metric);
formatter.field("dimensions", &self.dimensions);
formatter.finish()
}
}
/// See [`ResponseResourceMetricKey`](crate::model::ResponseResourceMetricKey)
pub mod response_resource_metric_key {
/// A builder for [`ResponseResourceMetricKey`](crate::model::ResponseResourceMetricKey)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) metric: std::option::Option<std::string::String>,
pub(crate) dimensions: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
/// <p>The name of a Performance Insights metric to be measured.</p>
/// <p>Valid values for <code>Metric</code> are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db.load.avg</code> - a scaled representation of the number of active sessions
/// for the database engine.</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sampledload.avg</code> - the raw number of active sessions for the
/// database engine.</p>
/// </li>
/// </ul>
/// <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code>
/// are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code>
/// showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>.
/// For most use cases, you can query <code>db.load.avg</code> only. </p>
pub fn metric(mut self, input: impl Into<std::string::String>) -> Self {
self.metric = Some(input.into());
self
}
/// <p>The name of a Performance Insights metric to be measured.</p>
/// <p>Valid values for <code>Metric</code> are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db.load.avg</code> - a scaled representation of the number of active sessions
/// for the database engine.</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sampledload.avg</code> - the raw number of active sessions for the
/// database engine.</p>
/// </li>
/// </ul>
/// <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code>
/// are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code>
/// showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>.
/// For most use cases, you can query <code>db.load.avg</code> only. </p>
pub fn set_metric(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metric = input;
self
}
/// Adds a key-value pair to `dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The valid dimensions for the metric.</p>
pub fn dimensions(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.dimensions.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.dimensions = Some(hash_map);
self
}
/// <p>The valid dimensions for the metric.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.dimensions = input;
self
}
/// Consumes the builder and constructs a [`ResponseResourceMetricKey`](crate::model::ResponseResourceMetricKey)
pub fn build(self) -> crate::model::ResponseResourceMetricKey {
crate::model::ResponseResourceMetricKey {
metric: self.metric,
dimensions: self.dimensions,
}
}
}
}
impl ResponseResourceMetricKey {
/// Creates a new builder-style object to manufacture [`ResponseResourceMetricKey`](crate::model::ResponseResourceMetricKey)
pub fn builder() -> crate::model::response_resource_metric_key::Builder {
crate::model::response_resource_metric_key::Builder::default()
}
}
/// <p>A single query to be processed. You must provide the metric to query. If no other
/// parameters are specified, Performance Insights returns all of the data points for that metric. You can
/// optionally request that the data points be aggregated by dimension group (
/// <code>GroupBy</code>), and return only those data points that match your criteria (<code>Filter</code>).</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricQuery {
/// <p>The name of a Performance Insights metric to be measured.</p>
/// <p>Valid values for <code>Metric</code> are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db.load.avg</code> - a scaled representation of the number of active sessions
/// for the database engine.</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sampledload.avg</code> - the raw number of active sessions for the
/// database engine.</p>
/// </li>
/// </ul>
/// <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code>
/// are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code>
/// showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>.
/// For most use cases, you can query <code>db.load.avg</code> only. </p>
pub metric: std::option::Option<std::string::String>,
/// <p>A specification for how to aggregate the data points from a query result. You must
/// specify a valid dimension group. Performance Insights will return all of the dimensions within that group,
/// unless you provide the names of specific dimensions within that group. You can also request
/// that Performance Insights return a limited number of values for a dimension.</p>
pub group_by: std::option::Option<crate::model::DimensionGroup>,
/// <p>One or more filters to apply in the request. Restrictions:</p>
/// <ul>
/// <li>
/// <p>Any number of filters by the same dimension, as specified in the <code>GroupBy</code> parameter.</p>
/// </li>
/// <li>
/// <p>A single filter for any other dimension in this dimension group.</p>
/// </li>
/// </ul>
pub filter:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl std::fmt::Debug for MetricQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricQuery");
formatter.field("metric", &self.metric);
formatter.field("group_by", &self.group_by);
formatter.field("filter", &self.filter);
formatter.finish()
}
}
/// See [`MetricQuery`](crate::model::MetricQuery)
pub mod metric_query {
/// A builder for [`MetricQuery`](crate::model::MetricQuery)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) metric: std::option::Option<std::string::String>,
pub(crate) group_by: std::option::Option<crate::model::DimensionGroup>,
pub(crate) filter: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
/// <p>The name of a Performance Insights metric to be measured.</p>
/// <p>Valid values for <code>Metric</code> are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db.load.avg</code> - a scaled representation of the number of active sessions
/// for the database engine.</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sampledload.avg</code> - the raw number of active sessions for the
/// database engine.</p>
/// </li>
/// </ul>
/// <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code>
/// are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code>
/// showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>.
/// For most use cases, you can query <code>db.load.avg</code> only. </p>
pub fn metric(mut self, input: impl Into<std::string::String>) -> Self {
self.metric = Some(input.into());
self
}
/// <p>The name of a Performance Insights metric to be measured.</p>
/// <p>Valid values for <code>Metric</code> are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db.load.avg</code> - a scaled representation of the number of active sessions
/// for the database engine.</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sampledload.avg</code> - the raw number of active sessions for the
/// database engine.</p>
/// </li>
/// </ul>
/// <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code>
/// are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code>
/// showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>.
/// For most use cases, you can query <code>db.load.avg</code> only. </p>
pub fn set_metric(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metric = input;
self
}
/// <p>A specification for how to aggregate the data points from a query result. You must
/// specify a valid dimension group. Performance Insights will return all of the dimensions within that group,
/// unless you provide the names of specific dimensions within that group. You can also request
/// that Performance Insights return a limited number of values for a dimension.</p>
pub fn group_by(mut self, input: crate::model::DimensionGroup) -> Self {
self.group_by = Some(input);
self
}
/// <p>A specification for how to aggregate the data points from a query result. You must
/// specify a valid dimension group. Performance Insights will return all of the dimensions within that group,
/// unless you provide the names of specific dimensions within that group. You can also request
/// that Performance Insights return a limited number of values for a dimension.</p>
pub fn set_group_by(
mut self,
input: std::option::Option<crate::model::DimensionGroup>,
) -> Self {
self.group_by = input;
self
}
/// Adds a key-value pair to `filter`.
///
/// To override the contents of this collection use [`set_filter`](Self::set_filter).
///
/// <p>One or more filters to apply in the request. Restrictions:</p>
/// <ul>
/// <li>
/// <p>Any number of filters by the same dimension, as specified in the <code>GroupBy</code> parameter.</p>
/// </li>
/// <li>
/// <p>A single filter for any other dimension in this dimension group.</p>
/// </li>
/// </ul>
pub fn filter(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.filter.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.filter = Some(hash_map);
self
}
/// <p>One or more filters to apply in the request. Restrictions:</p>
/// <ul>
/// <li>
/// <p>Any number of filters by the same dimension, as specified in the <code>GroupBy</code> parameter.</p>
/// </li>
/// <li>
/// <p>A single filter for any other dimension in this dimension group.</p>
/// </li>
/// </ul>
pub fn set_filter(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.filter = input;
self
}
/// Consumes the builder and constructs a [`MetricQuery`](crate::model::MetricQuery)
pub fn build(self) -> crate::model::MetricQuery {
crate::model::MetricQuery {
metric: self.metric,
group_by: self.group_by,
filter: self.filter,
}
}
}
}
impl MetricQuery {
/// Creates a new builder-style object to manufacture [`MetricQuery`](crate::model::MetricQuery)
pub fn builder() -> crate::model::metric_query::Builder {
crate::model::metric_query::Builder::default()
}
}
/// <p>A logical grouping of Performance Insights metrics for a related subject area. For example, the
/// <code>db.sql</code> dimension group consists of the following dimensions:
/// <code>db.sql.id</code>, <code>db.sql.db_id</code>, <code>db.sql.statement</code>, and
/// <code>db.sql.tokenized_id</code>.</p>
/// <note>
/// <p>Each response element returns a maximum of 500 bytes. For larger elements, such as SQL statements,
/// only the first 500 bytes are returned.</p>
/// </note>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DimensionGroup {
/// <p>The name of the dimension group. Valid values are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db</code> - The name of the database to which the client is connected (only Aurora PostgreSQL, RDS
/// PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.application</code> - The name of the application that is connected to the database (only Aurora
/// PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.host</code> - The host name of the connected client (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.session_type</code> - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql</code> - The SQL that is currently executing (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized</code> - The SQL digest (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event</code> - The event for which the database backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event_type</code> - The type of event for which the database backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.user</code> - The user logged in to the database (all engines)</p>
/// </li>
/// </ul>
pub group: std::option::Option<std::string::String>,
/// <p>A list of specific dimensions from a dimension group. If this parameter is not present,
/// then it signifies that all of the dimensions in the group were requested, or are present in
/// the response.</p>
/// <p>Valid values for elements in the <code>Dimensions</code> array are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db.application.name</code> - The name of the application that is connected to the database (only
/// Aurora PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.host.id</code> - The host ID of the connected client (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.host.name</code> - The host name of the connected client (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.name</code> - The name of the database to which the client is connected (only Aurora
/// PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.session_type.name</code> - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.id</code> - The SQL ID generated by Performance Insights (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.db_id</code> - The SQL ID generated by the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.statement</code> - The SQL text that is being executed (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.tokenized_id</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized.id</code> - The SQL digest ID generated by Performance Insights (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized.db_id</code> - SQL digest ID generated by the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized.statement</code> - The SQL digest text (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.user.id</code> - The ID of the user logged in to the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.user.name</code> - The name of the user logged in to the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event.name</code> - The event for which the backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event.type</code> - The type of event for which the backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event_type.name</code> - The name of the event type for which the backend is waiting (all
/// engines)</p>
/// </li>
/// </ul>
pub dimensions: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The maximum number of items to fetch for this dimension group.</p>
pub limit: std::option::Option<i32>,
}
impl std::fmt::Debug for DimensionGroup {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DimensionGroup");
formatter.field("group", &self.group);
formatter.field("dimensions", &self.dimensions);
formatter.field("limit", &self.limit);
formatter.finish()
}
}
/// See [`DimensionGroup`](crate::model::DimensionGroup)
pub mod dimension_group {
/// A builder for [`DimensionGroup`](crate::model::DimensionGroup)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) group: std::option::Option<std::string::String>,
pub(crate) dimensions: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) limit: std::option::Option<i32>,
}
impl Builder {
/// <p>The name of the dimension group. Valid values are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db</code> - The name of the database to which the client is connected (only Aurora PostgreSQL, RDS
/// PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.application</code> - The name of the application that is connected to the database (only Aurora
/// PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.host</code> - The host name of the connected client (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.session_type</code> - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql</code> - The SQL that is currently executing (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized</code> - The SQL digest (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event</code> - The event for which the database backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event_type</code> - The type of event for which the database backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.user</code> - The user logged in to the database (all engines)</p>
/// </li>
/// </ul>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.group = Some(input.into());
self
}
/// <p>The name of the dimension group. Valid values are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db</code> - The name of the database to which the client is connected (only Aurora PostgreSQL, RDS
/// PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.application</code> - The name of the application that is connected to the database (only Aurora
/// PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.host</code> - The host name of the connected client (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.session_type</code> - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql</code> - The SQL that is currently executing (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized</code> - The SQL digest (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event</code> - The event for which the database backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event_type</code> - The type of event for which the database backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.user</code> - The user logged in to the database (all engines)</p>
/// </li>
/// </ul>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.group = input;
self
}
/// Appends an item to `dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>A list of specific dimensions from a dimension group. If this parameter is not present,
/// then it signifies that all of the dimensions in the group were requested, or are present in
/// the response.</p>
/// <p>Valid values for elements in the <code>Dimensions</code> array are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db.application.name</code> - The name of the application that is connected to the database (only
/// Aurora PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.host.id</code> - The host ID of the connected client (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.host.name</code> - The host name of the connected client (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.name</code> - The name of the database to which the client is connected (only Aurora
/// PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.session_type.name</code> - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.id</code> - The SQL ID generated by Performance Insights (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.db_id</code> - The SQL ID generated by the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.statement</code> - The SQL text that is being executed (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.tokenized_id</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized.id</code> - The SQL digest ID generated by Performance Insights (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized.db_id</code> - SQL digest ID generated by the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized.statement</code> - The SQL digest text (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.user.id</code> - The ID of the user logged in to the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.user.name</code> - The name of the user logged in to the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event.name</code> - The event for which the backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event.type</code> - The type of event for which the backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event_type.name</code> - The name of the event type for which the backend is waiting (all
/// engines)</p>
/// </li>
/// </ul>
pub fn dimensions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.dimensions.unwrap_or_default();
v.push(input.into());
self.dimensions = Some(v);
self
}
/// <p>A list of specific dimensions from a dimension group. If this parameter is not present,
/// then it signifies that all of the dimensions in the group were requested, or are present in
/// the response.</p>
/// <p>Valid values for elements in the <code>Dimensions</code> array are:</p>
///
/// <ul>
/// <li>
/// <p>
/// <code>db.application.name</code> - The name of the application that is connected to the database (only
/// Aurora PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.host.id</code> - The host ID of the connected client (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.host.name</code> - The host name of the connected client (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.name</code> - The name of the database to which the client is connected (only Aurora
/// PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.session_type.name</code> - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.id</code> - The SQL ID generated by Performance Insights (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.db_id</code> - The SQL ID generated by the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.statement</code> - The SQL text that is being executed (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql.tokenized_id</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized.id</code> - The SQL digest ID generated by Performance Insights (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized.db_id</code> - SQL digest ID generated by the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.sql_tokenized.statement</code> - The SQL digest text (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.user.id</code> - The ID of the user logged in to the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.user.name</code> - The name of the user logged in to the database (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event.name</code> - The event for which the backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event.type</code> - The type of event for which the backend is waiting (all engines)</p>
/// </li>
/// <li>
/// <p>
/// <code>db.wait_event_type.name</code> - The name of the event type for which the backend is waiting (all
/// engines)</p>
/// </li>
/// </ul>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.dimensions = input;
self
}
/// <p>The maximum number of items to fetch for this dimension group.</p>
pub fn limit(mut self, input: i32) -> Self {
self.limit = Some(input);
self
}
/// <p>The maximum number of items to fetch for this dimension group.</p>
pub fn set_limit(mut self, input: std::option::Option<i32>) -> Self {
self.limit = input;
self
}
/// Consumes the builder and constructs a [`DimensionGroup`](crate::model::DimensionGroup)
pub fn build(self) -> crate::model::DimensionGroup {
crate::model::DimensionGroup {
group: self.group,
dimensions: self.dimensions,
limit: self.limit,
}
}
}
}
impl DimensionGroup {
/// Creates a new builder-style object to manufacture [`DimensionGroup`](crate::model::DimensionGroup)
pub fn builder() -> crate::model::dimension_group::Builder {
crate::model::dimension_group::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ServiceType {
#[allow(missing_docs)] // documentation missing in model
Rds,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ServiceType {
fn from(s: &str) -> Self {
match s {
"RDS" => ServiceType::Rds,
other => ServiceType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ServiceType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ServiceType::from(s))
}
}
impl ServiceType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ServiceType::Rds => "RDS",
ServiceType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["RDS"]
}
}
impl AsRef<str> for ServiceType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>An object that describes the details for a specified dimension.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DimensionKeyDetail {
/// <p>The value of the dimension detail data. For the <code>db.sql.statement</code> dimension, this value is either the
/// full or truncated SQL query, depending on the return status.</p>
pub value: std::option::Option<std::string::String>,
/// <p>The full name of the dimension. The full name includes the group name and key name. The only valid value is
/// <code>db.sql.statement</code>. </p>
pub dimension: std::option::Option<std::string::String>,
/// <p>The status of the dimension detail data. Possible values include the following:</p>
/// <ul>
/// <li>
/// <p>
/// <code>AVAILABLE</code> - The dimension detail data is ready to be retrieved.</p>
/// </li>
/// <li>
/// <p>
/// <code>PROCESSING</code> - The dimension detail data isn't ready to be retrieved because more processing time is
/// required. If the requested detail data for <code>db.sql.statement</code> has the status <code>PROCESSING</code>,
/// Performance Insights returns the truncated query.</p>
/// </li>
/// <li>
/// <p>
/// <code>UNAVAILABLE</code> - The dimension detail data could not be collected successfully.</p>
/// </li>
/// </ul>
pub status: std::option::Option<crate::model::DetailStatus>,
}
impl std::fmt::Debug for DimensionKeyDetail {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DimensionKeyDetail");
formatter.field("value", &self.value);
formatter.field("dimension", &self.dimension);
formatter.field("status", &self.status);
formatter.finish()
}
}
/// See [`DimensionKeyDetail`](crate::model::DimensionKeyDetail)
pub mod dimension_key_detail {
/// A builder for [`DimensionKeyDetail`](crate::model::DimensionKeyDetail)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) value: std::option::Option<std::string::String>,
pub(crate) dimension: std::option::Option<std::string::String>,
pub(crate) status: std::option::Option<crate::model::DetailStatus>,
}
impl Builder {
/// <p>The value of the dimension detail data. For the <code>db.sql.statement</code> dimension, this value is either the
/// full or truncated SQL query, depending on the return status.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The value of the dimension detail data. For the <code>db.sql.statement</code> dimension, this value is either the
/// full or truncated SQL query, depending on the return status.</p>
pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
self.value = input;
self
}
/// <p>The full name of the dimension. The full name includes the group name and key name. The only valid value is
/// <code>db.sql.statement</code>. </p>
pub fn dimension(mut self, input: impl Into<std::string::String>) -> Self {
self.dimension = Some(input.into());
self
}
/// <p>The full name of the dimension. The full name includes the group name and key name. The only valid value is
/// <code>db.sql.statement</code>. </p>
pub fn set_dimension(mut self, input: std::option::Option<std::string::String>) -> Self {
self.dimension = input;
self
}
/// <p>The status of the dimension detail data. Possible values include the following:</p>
/// <ul>
/// <li>
/// <p>
/// <code>AVAILABLE</code> - The dimension detail data is ready to be retrieved.</p>
/// </li>
/// <li>
/// <p>
/// <code>PROCESSING</code> - The dimension detail data isn't ready to be retrieved because more processing time is
/// required. If the requested detail data for <code>db.sql.statement</code> has the status <code>PROCESSING</code>,
/// Performance Insights returns the truncated query.</p>
/// </li>
/// <li>
/// <p>
/// <code>UNAVAILABLE</code> - The dimension detail data could not be collected successfully.</p>
/// </li>
/// </ul>
pub fn status(mut self, input: crate::model::DetailStatus) -> Self {
self.status = Some(input);
self
}
/// <p>The status of the dimension detail data. Possible values include the following:</p>
/// <ul>
/// <li>
/// <p>
/// <code>AVAILABLE</code> - The dimension detail data is ready to be retrieved.</p>
/// </li>
/// <li>
/// <p>
/// <code>PROCESSING</code> - The dimension detail data isn't ready to be retrieved because more processing time is
/// required. If the requested detail data for <code>db.sql.statement</code> has the status <code>PROCESSING</code>,
/// Performance Insights returns the truncated query.</p>
/// </li>
/// <li>
/// <p>
/// <code>UNAVAILABLE</code> - The dimension detail data could not be collected successfully.</p>
/// </li>
/// </ul>
pub fn set_status(
mut self,
input: std::option::Option<crate::model::DetailStatus>,
) -> Self {
self.status = input;
self
}
/// Consumes the builder and constructs a [`DimensionKeyDetail`](crate::model::DimensionKeyDetail)
pub fn build(self) -> crate::model::DimensionKeyDetail {
crate::model::DimensionKeyDetail {
value: self.value,
dimension: self.dimension,
status: self.status,
}
}
}
}
impl DimensionKeyDetail {
/// Creates a new builder-style object to manufacture [`DimensionKeyDetail`](crate::model::DimensionKeyDetail)
pub fn builder() -> crate::model::dimension_key_detail::Builder {
crate::model::dimension_key_detail::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum DetailStatus {
#[allow(missing_docs)] // documentation missing in model
Available,
#[allow(missing_docs)] // documentation missing in model
Processing,
#[allow(missing_docs)] // documentation missing in model
Unavailable,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for DetailStatus {
fn from(s: &str) -> Self {
match s {
"AVAILABLE" => DetailStatus::Available,
"PROCESSING" => DetailStatus::Processing,
"UNAVAILABLE" => DetailStatus::Unavailable,
other => DetailStatus::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for DetailStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(DetailStatus::from(s))
}
}
impl DetailStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
DetailStatus::Available => "AVAILABLE",
DetailStatus::Processing => "PROCESSING",
DetailStatus::Unavailable => "UNAVAILABLE",
DetailStatus::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["AVAILABLE", "PROCESSING", "UNAVAILABLE"]
}
}
impl AsRef<str> for DetailStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>An array of descriptions and aggregated values for
/// each dimension within a dimension group.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DimensionKeyDescription {
/// <p>A map of name-value pairs for the dimensions in the group.</p>
pub dimensions:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
/// <p>The aggregated metric value for the dimension(s), over the requested time range.</p>
pub total: std::option::Option<f64>,
/// <p>If <code>PartitionBy</code> was specified, <code>PartitionKeys</code> contains the dimensions that were.</p>
pub partitions: std::option::Option<std::vec::Vec<f64>>,
}
impl std::fmt::Debug for DimensionKeyDescription {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DimensionKeyDescription");
formatter.field("dimensions", &self.dimensions);
formatter.field("total", &self.total);
formatter.field("partitions", &self.partitions);
formatter.finish()
}
}
/// See [`DimensionKeyDescription`](crate::model::DimensionKeyDescription)
pub mod dimension_key_description {
/// A builder for [`DimensionKeyDescription`](crate::model::DimensionKeyDescription)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) dimensions: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) total: std::option::Option<f64>,
pub(crate) partitions: std::option::Option<std::vec::Vec<f64>>,
}
impl Builder {
/// Adds a key-value pair to `dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>A map of name-value pairs for the dimensions in the group.</p>
pub fn dimensions(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.dimensions.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.dimensions = Some(hash_map);
self
}
/// <p>A map of name-value pairs for the dimensions in the group.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.dimensions = input;
self
}
/// <p>The aggregated metric value for the dimension(s), over the requested time range.</p>
pub fn total(mut self, input: f64) -> Self {
self.total = Some(input);
self
}
/// <p>The aggregated metric value for the dimension(s), over the requested time range.</p>
pub fn set_total(mut self, input: std::option::Option<f64>) -> Self {
self.total = input;
self
}
/// Appends an item to `partitions`.
///
/// To override the contents of this collection use [`set_partitions`](Self::set_partitions).
///
/// <p>If <code>PartitionBy</code> was specified, <code>PartitionKeys</code> contains the dimensions that were.</p>
pub fn partitions(mut self, input: impl Into<f64>) -> Self {
let mut v = self.partitions.unwrap_or_default();
v.push(input.into());
self.partitions = Some(v);
self
}
/// <p>If <code>PartitionBy</code> was specified, <code>PartitionKeys</code> contains the dimensions that were.</p>
pub fn set_partitions(mut self, input: std::option::Option<std::vec::Vec<f64>>) -> Self {
self.partitions = input;
self
}
/// Consumes the builder and constructs a [`DimensionKeyDescription`](crate::model::DimensionKeyDescription)
pub fn build(self) -> crate::model::DimensionKeyDescription {
crate::model::DimensionKeyDescription {
dimensions: self.dimensions,
total: self.total,
partitions: self.partitions,
}
}
}
}
impl DimensionKeyDescription {
/// Creates a new builder-style object to manufacture [`DimensionKeyDescription`](crate::model::DimensionKeyDescription)
pub fn builder() -> crate::model::dimension_key_description::Builder {
crate::model::dimension_key_description::Builder::default()
}
}
/// <p>If <code>PartitionBy</code> was specified in a <code>DescribeDimensionKeys</code>
/// request, the dimensions are returned in an array. Each element in the array specifies one
/// dimension. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ResponsePartitionKey {
/// <p>A dimension map that contains the dimension(s) for this partition.</p>
pub dimensions:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl std::fmt::Debug for ResponsePartitionKey {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ResponsePartitionKey");
formatter.field("dimensions", &self.dimensions);
formatter.finish()
}
}
/// See [`ResponsePartitionKey`](crate::model::ResponsePartitionKey)
pub mod response_partition_key {
/// A builder for [`ResponsePartitionKey`](crate::model::ResponsePartitionKey)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) dimensions: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
/// Adds a key-value pair to `dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>A dimension map that contains the dimension(s) for this partition.</p>
pub fn dimensions(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.dimensions.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.dimensions = Some(hash_map);
self
}
/// <p>A dimension map that contains the dimension(s) for this partition.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.dimensions = input;
self
}
/// Consumes the builder and constructs a [`ResponsePartitionKey`](crate::model::ResponsePartitionKey)
pub fn build(self) -> crate::model::ResponsePartitionKey {
crate::model::ResponsePartitionKey {
dimensions: self.dimensions,
}
}
}
}
impl ResponsePartitionKey {
/// Creates a new builder-style object to manufacture [`ResponsePartitionKey`](crate::model::ResponsePartitionKey)
pub fn builder() -> crate::model::response_partition_key::Builder {
crate::model::response_partition_key::Builder::default()
}
}