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 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[derive(Debug)]
pub(crate) struct Handle<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
pub(crate) client: aws_smithy_client::Client<C, M, R>,
pub(crate) conf: crate::Config,
}
/// Client for AWS Health APIs and Notifications
///
/// Client for invoking operations on AWS Health APIs and Notifications. Each operation on AWS Health APIs and Notifications is a method on this
/// this struct. `.send()` MUST be invoked on the generated operations to dispatch the request to the service.
///
/// # Examples
/// **Constructing a client and invoking an operation**
/// ```rust,no_run
/// # async fn docs() {
/// // create a shared configuration. This can be used & shared between multiple service clients.
/// let shared_config = aws_config::load_from_env().await;
/// let client = aws_sdk_health::Client::new(&shared_config);
/// // invoke an operation
/// /* let rsp = client
/// .<operation_name>().
/// .<param>("some value")
/// .send().await; */
/// # }
/// ```
/// **Constructing a client with custom configuration**
/// ```rust,no_run
/// use aws_config::RetryConfig;
/// # async fn docs() {
/// let shared_config = aws_config::load_from_env().await;
/// let config = aws_sdk_health::config::Builder::from(&shared_config)
/// .retry_config(RetryConfig::disabled())
/// .build();
/// let client = aws_sdk_health::Client::from_conf(config);
/// # }
#[derive(std::fmt::Debug)]
pub struct Client<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<Handle<C, M, R>>,
}
impl<C, M, R> std::clone::Clone for Client<C, M, R> {
fn clone(&self) -> Self {
Self {
handle: self.handle.clone(),
}
}
}
#[doc(inline)]
pub use aws_smithy_client::Builder;
impl<C, M, R> From<aws_smithy_client::Client<C, M, R>> for Client<C, M, R> {
fn from(client: aws_smithy_client::Client<C, M, R>) -> Self {
Self::with_config(client, crate::Config::builder().build())
}
}
impl<C, M, R> Client<C, M, R> {
/// Creates a client with the given service configuration.
pub fn with_config(client: aws_smithy_client::Client<C, M, R>, conf: crate::Config) -> Self {
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
/// Returns the client's configuration.
pub fn conf(&self) -> &crate::Config {
&self.handle.conf
}
}
impl<C, M, R> Client<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Constructs a fluent builder for the [`DescribeAffectedAccountsForOrganization`](crate::client::fluent_builders::DescribeAffectedAccountsForOrganization) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeAffectedAccountsForOrganization::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`event_arn(impl Into<String>)`](crate::client::fluent_builders::DescribeAffectedAccountsForOrganization::event_arn) / [`set_event_arn(Option<String>)`](crate::client::fluent_builders::DescribeAffectedAccountsForOrganization::set_event_arn): <p>The unique identifier for the event. The event ARN has the <code>arn:aws:health:<i>event-region</i>::event/<i>SERVICE</i>/<i>EVENT_TYPE_CODE</i>/<i>EVENT_TYPE_PLUS_ID</i> </code> format.</p> <p>For example, an event ARN might look like the following:</p> <p> <code>arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456</code> </p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeAffectedAccountsForOrganization::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeAffectedAccountsForOrganization::set_next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeAffectedAccountsForOrganization::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeAffectedAccountsForOrganization::set_max_results): <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
/// - On success, responds with [`DescribeAffectedAccountsForOrganizationOutput`](crate::output::DescribeAffectedAccountsForOrganizationOutput) with field(s):
/// - [`affected_accounts(Option<Vec<String>>)`](crate::output::DescribeAffectedAccountsForOrganizationOutput::affected_accounts): <p>A JSON set of elements of the affected accounts.</p>
/// - [`event_scope_code(Option<EventScopeCode>)`](crate::output::DescribeAffectedAccountsForOrganizationOutput::event_scope_code): <p>This parameter specifies if the Health event is a public Amazon Web Services service event or an account-specific event.</p> <ul> <li> <p>If the <code>eventScopeCode</code> value is <code>PUBLIC</code>, then the <code>affectedAccounts</code> value is always empty.</p> </li> <li> <p>If the <code>eventScopeCode</code> value is <code>ACCOUNT_SPECIFIC</code>, then the <code>affectedAccounts</code> value lists the affected Amazon Web Services accounts in your organization. For example, if an event affects a service such as Amazon Elastic Compute Cloud and you have Amazon Web Services accounts that use that service, those account IDs appear in the response.</p> </li> <li> <p>If the <code>eventScopeCode</code> value is <code>NONE</code>, then the <code>eventArn</code> that you specified in the request is invalid or doesn't exist.</p> </li> </ul>
/// - [`next_token(Option<String>)`](crate::output::DescribeAffectedAccountsForOrganizationOutput::next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - On failure, responds with [`SdkError<DescribeAffectedAccountsForOrganizationError>`](crate::error::DescribeAffectedAccountsForOrganizationError)
pub fn describe_affected_accounts_for_organization(
&self,
) -> fluent_builders::DescribeAffectedAccountsForOrganization<C, M, R> {
fluent_builders::DescribeAffectedAccountsForOrganization::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeAffectedEntities`](crate::client::fluent_builders::DescribeAffectedEntities) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeAffectedEntities::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`filter(EntityFilter)`](crate::client::fluent_builders::DescribeAffectedEntities::filter) / [`set_filter(Option<EntityFilter>)`](crate::client::fluent_builders::DescribeAffectedEntities::set_filter): <p>Values to narrow the results returned. At least one event ARN is required.</p>
/// - [`locale(impl Into<String>)`](crate::client::fluent_builders::DescribeAffectedEntities::locale) / [`set_locale(Option<String>)`](crate::client::fluent_builders::DescribeAffectedEntities::set_locale): <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeAffectedEntities::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeAffectedEntities::set_next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeAffectedEntities::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeAffectedEntities::set_max_results): <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
/// - On success, responds with [`DescribeAffectedEntitiesOutput`](crate::output::DescribeAffectedEntitiesOutput) with field(s):
/// - [`entities(Option<Vec<AffectedEntity>>)`](crate::output::DescribeAffectedEntitiesOutput::entities): <p>The entities that match the filter criteria.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeAffectedEntitiesOutput::next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - On failure, responds with [`SdkError<DescribeAffectedEntitiesError>`](crate::error::DescribeAffectedEntitiesError)
pub fn describe_affected_entities(&self) -> fluent_builders::DescribeAffectedEntities<C, M, R> {
fluent_builders::DescribeAffectedEntities::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeAffectedEntitiesForOrganization`](crate::client::fluent_builders::DescribeAffectedEntitiesForOrganization) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeAffectedEntitiesForOrganization::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`organization_entity_filters(Vec<EventAccountFilter>)`](crate::client::fluent_builders::DescribeAffectedEntitiesForOrganization::organization_entity_filters) / [`set_organization_entity_filters(Option<Vec<EventAccountFilter>>)`](crate::client::fluent_builders::DescribeAffectedEntitiesForOrganization::set_organization_entity_filters): <p>A JSON set of elements including the <code>awsAccountId</code> and the <code>eventArn</code>.</p>
/// - [`locale(impl Into<String>)`](crate::client::fluent_builders::DescribeAffectedEntitiesForOrganization::locale) / [`set_locale(Option<String>)`](crate::client::fluent_builders::DescribeAffectedEntitiesForOrganization::set_locale): <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeAffectedEntitiesForOrganization::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeAffectedEntitiesForOrganization::set_next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeAffectedEntitiesForOrganization::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeAffectedEntitiesForOrganization::set_max_results): <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
/// - On success, responds with [`DescribeAffectedEntitiesForOrganizationOutput`](crate::output::DescribeAffectedEntitiesForOrganizationOutput) with field(s):
/// - [`entities(Option<Vec<AffectedEntity>>)`](crate::output::DescribeAffectedEntitiesForOrganizationOutput::entities): <p>A JSON set of elements including the <code>awsAccountId</code> and its <code>entityArn</code>, <code>entityValue</code> and its <code>entityArn</code>, <code>lastUpdatedTime</code>, and <code>statusCode</code>.</p>
/// - [`failed_set(Option<Vec<OrganizationAffectedEntitiesErrorItem>>)`](crate::output::DescribeAffectedEntitiesForOrganizationOutput::failed_set): <p>A JSON set of elements of the failed response, including the <code>awsAccountId</code>, <code>errorMessage</code>, <code>errorName</code>, and <code>eventArn</code>.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeAffectedEntitiesForOrganizationOutput::next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - On failure, responds with [`SdkError<DescribeAffectedEntitiesForOrganizationError>`](crate::error::DescribeAffectedEntitiesForOrganizationError)
pub fn describe_affected_entities_for_organization(
&self,
) -> fluent_builders::DescribeAffectedEntitiesForOrganization<C, M, R> {
fluent_builders::DescribeAffectedEntitiesForOrganization::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeEntityAggregates`](crate::client::fluent_builders::DescribeEntityAggregates) operation.
///
/// - The fluent builder is configurable:
/// - [`event_arns(Vec<String>)`](crate::client::fluent_builders::DescribeEntityAggregates::event_arns) / [`set_event_arns(Option<Vec<String>>)`](crate::client::fluent_builders::DescribeEntityAggregates::set_event_arns): <p>A list of event ARNs (unique identifiers). For example: <code>"arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-CDE456", "arn:aws:health:us-west-1::event/EBS/AWS_EBS_LOST_VOLUME/AWS_EBS_LOST_VOLUME_CHI789_JKL101"</code> </p>
/// - On success, responds with [`DescribeEntityAggregatesOutput`](crate::output::DescribeEntityAggregatesOutput) with field(s):
/// - [`entity_aggregates(Option<Vec<EntityAggregate>>)`](crate::output::DescribeEntityAggregatesOutput::entity_aggregates): <p>The number of entities that are affected by each of the specified events.</p>
/// - On failure, responds with [`SdkError<DescribeEntityAggregatesError>`](crate::error::DescribeEntityAggregatesError)
pub fn describe_entity_aggregates(&self) -> fluent_builders::DescribeEntityAggregates<C, M, R> {
fluent_builders::DescribeEntityAggregates::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeEventAggregates`](crate::client::fluent_builders::DescribeEventAggregates) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeEventAggregates::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`filter(EventFilter)`](crate::client::fluent_builders::DescribeEventAggregates::filter) / [`set_filter(Option<EventFilter>)`](crate::client::fluent_builders::DescribeEventAggregates::set_filter): <p>Values to narrow the results returned.</p>
/// - [`aggregate_field(EventAggregateField)`](crate::client::fluent_builders::DescribeEventAggregates::aggregate_field) / [`set_aggregate_field(Option<EventAggregateField>)`](crate::client::fluent_builders::DescribeEventAggregates::set_aggregate_field): <p>The only currently supported value is <code>eventTypeCategory</code>.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeEventAggregates::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeEventAggregates::set_max_results): <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeEventAggregates::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeEventAggregates::set_next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - On success, responds with [`DescribeEventAggregatesOutput`](crate::output::DescribeEventAggregatesOutput) with field(s):
/// - [`event_aggregates(Option<Vec<EventAggregate>>)`](crate::output::DescribeEventAggregatesOutput::event_aggregates): <p>The number of events in each category that meet the optional filter criteria.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeEventAggregatesOutput::next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - On failure, responds with [`SdkError<DescribeEventAggregatesError>`](crate::error::DescribeEventAggregatesError)
pub fn describe_event_aggregates(&self) -> fluent_builders::DescribeEventAggregates<C, M, R> {
fluent_builders::DescribeEventAggregates::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeEventDetails`](crate::client::fluent_builders::DescribeEventDetails) operation.
///
/// - The fluent builder is configurable:
/// - [`event_arns(Vec<String>)`](crate::client::fluent_builders::DescribeEventDetails::event_arns) / [`set_event_arns(Option<Vec<String>>)`](crate::client::fluent_builders::DescribeEventDetails::set_event_arns): <p>A list of event ARNs (unique identifiers). For example: <code>"arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-CDE456", "arn:aws:health:us-west-1::event/EBS/AWS_EBS_LOST_VOLUME/AWS_EBS_LOST_VOLUME_CHI789_JKL101"</code> </p>
/// - [`locale(impl Into<String>)`](crate::client::fluent_builders::DescribeEventDetails::locale) / [`set_locale(Option<String>)`](crate::client::fluent_builders::DescribeEventDetails::set_locale): <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
/// - On success, responds with [`DescribeEventDetailsOutput`](crate::output::DescribeEventDetailsOutput) with field(s):
/// - [`successful_set(Option<Vec<EventDetails>>)`](crate::output::DescribeEventDetailsOutput::successful_set): <p>Information about the events that could be retrieved.</p>
/// - [`failed_set(Option<Vec<EventDetailsErrorItem>>)`](crate::output::DescribeEventDetailsOutput::failed_set): <p>Error messages for any events that could not be retrieved.</p>
/// - On failure, responds with [`SdkError<DescribeEventDetailsError>`](crate::error::DescribeEventDetailsError)
pub fn describe_event_details(&self) -> fluent_builders::DescribeEventDetails<C, M, R> {
fluent_builders::DescribeEventDetails::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeEventDetailsForOrganization`](crate::client::fluent_builders::DescribeEventDetailsForOrganization) operation.
///
/// - The fluent builder is configurable:
/// - [`organization_event_detail_filters(Vec<EventAccountFilter>)`](crate::client::fluent_builders::DescribeEventDetailsForOrganization::organization_event_detail_filters) / [`set_organization_event_detail_filters(Option<Vec<EventAccountFilter>>)`](crate::client::fluent_builders::DescribeEventDetailsForOrganization::set_organization_event_detail_filters): <p>A set of JSON elements that includes the <code>awsAccountId</code> and the <code>eventArn</code>.</p>
/// - [`locale(impl Into<String>)`](crate::client::fluent_builders::DescribeEventDetailsForOrganization::locale) / [`set_locale(Option<String>)`](crate::client::fluent_builders::DescribeEventDetailsForOrganization::set_locale): <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
/// - On success, responds with [`DescribeEventDetailsForOrganizationOutput`](crate::output::DescribeEventDetailsForOrganizationOutput) with field(s):
/// - [`successful_set(Option<Vec<OrganizationEventDetails>>)`](crate::output::DescribeEventDetailsForOrganizationOutput::successful_set): <p>Information about the events that could be retrieved.</p>
/// - [`failed_set(Option<Vec<OrganizationEventDetailsErrorItem>>)`](crate::output::DescribeEventDetailsForOrganizationOutput::failed_set): <p>Error messages for any events that could not be retrieved.</p>
/// - On failure, responds with [`SdkError<DescribeEventDetailsForOrganizationError>`](crate::error::DescribeEventDetailsForOrganizationError)
pub fn describe_event_details_for_organization(
&self,
) -> fluent_builders::DescribeEventDetailsForOrganization<C, M, R> {
fluent_builders::DescribeEventDetailsForOrganization::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeEvents`](crate::client::fluent_builders::DescribeEvents) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeEvents::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`filter(EventFilter)`](crate::client::fluent_builders::DescribeEvents::filter) / [`set_filter(Option<EventFilter>)`](crate::client::fluent_builders::DescribeEvents::set_filter): <p>Values to narrow the results returned.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeEvents::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeEvents::set_next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeEvents::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeEvents::set_max_results): <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
/// - [`locale(impl Into<String>)`](crate::client::fluent_builders::DescribeEvents::locale) / [`set_locale(Option<String>)`](crate::client::fluent_builders::DescribeEvents::set_locale): <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
/// - On success, responds with [`DescribeEventsOutput`](crate::output::DescribeEventsOutput) with field(s):
/// - [`events(Option<Vec<Event>>)`](crate::output::DescribeEventsOutput::events): <p>The events that match the specified filter criteria.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeEventsOutput::next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - On failure, responds with [`SdkError<DescribeEventsError>`](crate::error::DescribeEventsError)
pub fn describe_events(&self) -> fluent_builders::DescribeEvents<C, M, R> {
fluent_builders::DescribeEvents::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeEventsForOrganization`](crate::client::fluent_builders::DescribeEventsForOrganization) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeEventsForOrganization::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`filter(OrganizationEventFilter)`](crate::client::fluent_builders::DescribeEventsForOrganization::filter) / [`set_filter(Option<OrganizationEventFilter>)`](crate::client::fluent_builders::DescribeEventsForOrganization::set_filter): <p>Values to narrow the results returned.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeEventsForOrganization::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeEventsForOrganization::set_next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeEventsForOrganization::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeEventsForOrganization::set_max_results): <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
/// - [`locale(impl Into<String>)`](crate::client::fluent_builders::DescribeEventsForOrganization::locale) / [`set_locale(Option<String>)`](crate::client::fluent_builders::DescribeEventsForOrganization::set_locale): <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
/// - On success, responds with [`DescribeEventsForOrganizationOutput`](crate::output::DescribeEventsForOrganizationOutput) with field(s):
/// - [`events(Option<Vec<OrganizationEvent>>)`](crate::output::DescribeEventsForOrganizationOutput::events): <p>The events that match the specified filter criteria.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeEventsForOrganizationOutput::next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - On failure, responds with [`SdkError<DescribeEventsForOrganizationError>`](crate::error::DescribeEventsForOrganizationError)
pub fn describe_events_for_organization(
&self,
) -> fluent_builders::DescribeEventsForOrganization<C, M, R> {
fluent_builders::DescribeEventsForOrganization::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeEventTypes`](crate::client::fluent_builders::DescribeEventTypes) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeEventTypes::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`filter(EventTypeFilter)`](crate::client::fluent_builders::DescribeEventTypes::filter) / [`set_filter(Option<EventTypeFilter>)`](crate::client::fluent_builders::DescribeEventTypes::set_filter): <p>Values to narrow the results returned.</p>
/// - [`locale(impl Into<String>)`](crate::client::fluent_builders::DescribeEventTypes::locale) / [`set_locale(Option<String>)`](crate::client::fluent_builders::DescribeEventTypes::set_locale): <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeEventTypes::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeEventTypes::set_next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeEventTypes::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeEventTypes::set_max_results): <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
/// - On success, responds with [`DescribeEventTypesOutput`](crate::output::DescribeEventTypesOutput) with field(s):
/// - [`event_types(Option<Vec<EventType>>)`](crate::output::DescribeEventTypesOutput::event_types): <p>A list of event types that match the filter criteria. Event types have a category (<code>issue</code>, <code>accountNotification</code>, or <code>scheduledChange</code>), a service (for example, <code>EC2</code>, <code>RDS</code>, <code>DATAPIPELINE</code>, <code>BILLING</code>), and a code (in the format <code>AWS_<i>SERVICE</i>_<i>DESCRIPTION</i> </code>; for example, <code>AWS_EC2_SYSTEM_MAINTENANCE_EVENT</code>).</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeEventTypesOutput::next_token): <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
/// - On failure, responds with [`SdkError<DescribeEventTypesError>`](crate::error::DescribeEventTypesError)
pub fn describe_event_types(&self) -> fluent_builders::DescribeEventTypes<C, M, R> {
fluent_builders::DescribeEventTypes::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeHealthServiceStatusForOrganization`](crate::client::fluent_builders::DescribeHealthServiceStatusForOrganization) operation.
///
/// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::DescribeHealthServiceStatusForOrganization::send) it.
/// - On success, responds with [`DescribeHealthServiceStatusForOrganizationOutput`](crate::output::DescribeHealthServiceStatusForOrganizationOutput) with field(s):
/// - [`health_service_access_status_for_organization(Option<String>)`](crate::output::DescribeHealthServiceStatusForOrganizationOutput::health_service_access_status_for_organization): <p>Information about the status of enabling or disabling the Health organizational view feature in your organization.</p> <p>Valid values are <code>ENABLED | DISABLED | PENDING</code>. </p>
/// - On failure, responds with [`SdkError<DescribeHealthServiceStatusForOrganizationError>`](crate::error::DescribeHealthServiceStatusForOrganizationError)
pub fn describe_health_service_status_for_organization(
&self,
) -> fluent_builders::DescribeHealthServiceStatusForOrganization<C, M, R> {
fluent_builders::DescribeHealthServiceStatusForOrganization::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DisableHealthServiceAccessForOrganization`](crate::client::fluent_builders::DisableHealthServiceAccessForOrganization) operation.
///
/// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::DisableHealthServiceAccessForOrganization::send) it.
/// - On success, responds with [`DisableHealthServiceAccessForOrganizationOutput`](crate::output::DisableHealthServiceAccessForOrganizationOutput)
/// - On failure, responds with [`SdkError<DisableHealthServiceAccessForOrganizationError>`](crate::error::DisableHealthServiceAccessForOrganizationError)
pub fn disable_health_service_access_for_organization(
&self,
) -> fluent_builders::DisableHealthServiceAccessForOrganization<C, M, R> {
fluent_builders::DisableHealthServiceAccessForOrganization::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`EnableHealthServiceAccessForOrganization`](crate::client::fluent_builders::EnableHealthServiceAccessForOrganization) operation.
///
/// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::EnableHealthServiceAccessForOrganization::send) it.
/// - On success, responds with [`EnableHealthServiceAccessForOrganizationOutput`](crate::output::EnableHealthServiceAccessForOrganizationOutput)
/// - On failure, responds with [`SdkError<EnableHealthServiceAccessForOrganizationError>`](crate::error::EnableHealthServiceAccessForOrganizationError)
pub fn enable_health_service_access_for_organization(
&self,
) -> fluent_builders::EnableHealthServiceAccessForOrganization<C, M, R> {
fluent_builders::EnableHealthServiceAccessForOrganization::new(self.handle.clone())
}
}
pub mod fluent_builders {
//!
//! Utilities to ergonomically construct a request to the service.
//!
//! Fluent builders are created through the [`Client`](crate::client::Client) by calling
//! one if its operation methods. After parameters are set using the builder methods,
//! the `send` method can be called to initiate the request.
//!
/// Fluent builder constructing a request to `DescribeAffectedAccountsForOrganization`.
///
/// <p>Returns a list of accounts in the organization from Organizations that are affected by the provided event. For more information about the different types of Health events, see <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_Event.html">Event</a>. </p>
/// <p>Before you can call this operation, you must first enable Health to work with Organizations. To do this, call the <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_EnableHealthServiceAccessForOrganization.html">EnableHealthServiceAccessForOrganization</a> operation from your organization's management account.</p> <note>
/// <p>This API operation uses pagination. Specify the <code>nextToken</code> parameter in the next request to return more results.</p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeAffectedAccountsForOrganization<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_affected_accounts_for_organization_input::Builder,
}
impl<C, M, R> DescribeAffectedAccountsForOrganization<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeAffectedAccountsForOrganization`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeAffectedAccountsForOrganizationOutput,
aws_smithy_http::result::SdkError<
crate::error::DescribeAffectedAccountsForOrganizationError,
>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeAffectedAccountsForOrganizationInputOperationOutputAlias,
crate::output::DescribeAffectedAccountsForOrganizationOutput,
crate::error::DescribeAffectedAccountsForOrganizationError,
crate::input::DescribeAffectedAccountsForOrganizationInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeAffectedAccountsForOrganizationPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(
self,
) -> crate::paginator::DescribeAffectedAccountsForOrganizationPaginator<C, M, R> {
crate::paginator::DescribeAffectedAccountsForOrganizationPaginator::new(
self.handle,
self.inner,
)
}
/// <p>The unique identifier for the event. The event ARN has the <code>arn:aws:health:<i>event-region</i>::event/<i>SERVICE</i>/<i>EVENT_TYPE_CODE</i>/<i>EVENT_TYPE_PLUS_ID</i> </code> format.</p>
/// <p>For example, an event ARN might look like the following:</p>
/// <p> <code>arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456</code> </p>
pub fn event_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.event_arn(input.into());
self
}
/// <p>The unique identifier for the event. The event ARN has the <code>arn:aws:health:<i>event-region</i>::event/<i>SERVICE</i>/<i>EVENT_TYPE_CODE</i>/<i>EVENT_TYPE_PLUS_ID</i> </code> format.</p>
/// <p>For example, an event ARN might look like the following:</p>
/// <p> <code>arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456</code> </p>
pub fn set_event_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_event_arn(input);
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
}
/// Fluent builder constructing a request to `DescribeAffectedEntities`.
///
/// <p>Returns a list of entities that have been affected by the specified events, based on the specified filter criteria. Entities can refer to individual customer resources, groups of customer resources, or any other construct, depending on the Amazon Web Services service. Events that have impact beyond that of the affected entities, or where the extent of impact is unknown, include at least one entity indicating this.</p>
/// <p>At least one event ARN is required.</p> <note>
/// <ul>
/// <li> <p>This API operation uses pagination. Specify the <code>nextToken</code> parameter in the next request to return more results.</p> </li>
/// <li> <p>This operation supports resource-level permissions. You can use this operation to allow or deny access to specific Health events. For more information, see <a href="https://docs.aws.amazon.com/health/latest/ug/security_iam_id-based-policy-examples.html#resource-action-based-conditions">Resource- and action-based conditions</a> in the <i>Health User Guide</i>.</p> </li>
/// </ul>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeAffectedEntities<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_affected_entities_input::Builder,
}
impl<C, M, R> DescribeAffectedEntities<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeAffectedEntities`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeAffectedEntitiesOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeAffectedEntitiesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeAffectedEntitiesInputOperationOutputAlias,
crate::output::DescribeAffectedEntitiesOutput,
crate::error::DescribeAffectedEntitiesError,
crate::input::DescribeAffectedEntitiesInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeAffectedEntitiesPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(
self,
) -> crate::paginator::DescribeAffectedEntitiesPaginator<C, M, R> {
crate::paginator::DescribeAffectedEntitiesPaginator::new(self.handle, self.inner)
}
/// <p>Values to narrow the results returned. At least one event ARN is required.</p>
pub fn filter(mut self, input: crate::model::EntityFilter) -> Self {
self.inner = self.inner.filter(input);
self
}
/// <p>Values to narrow the results returned. At least one event ARN is required.</p>
pub fn set_filter(
mut self,
input: std::option::Option<crate::model::EntityFilter>,
) -> Self {
self.inner = self.inner.set_filter(input);
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn locale(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.locale(input.into());
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn set_locale(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_locale(input);
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
}
/// Fluent builder constructing a request to `DescribeAffectedEntitiesForOrganization`.
///
/// <p>Returns a list of entities that have been affected by one or more events for one or more accounts in your organization in Organizations, based on the filter criteria. Entities can refer to individual customer resources, groups of customer resources, or any other construct, depending on the Amazon Web Services service.</p>
/// <p>At least one event Amazon Resource Name (ARN) and account ID are required.</p>
/// <p>Before you can call this operation, you must first enable Health to work with Organizations. To do this, call the <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_EnableHealthServiceAccessForOrganization.html">EnableHealthServiceAccessForOrganization</a> operation from your organization's management account.</p> <note>
/// <ul>
/// <li> <p>This API operation uses pagination. Specify the <code>nextToken</code> parameter in the next request to return more results.</p> </li>
/// <li> <p>This operation doesn't support resource-level permissions. You can't use this operation to allow or deny access to specific Health events. For more information, see <a href="https://docs.aws.amazon.com/health/latest/ug/security_iam_id-based-policy-examples.html#resource-action-based-conditions">Resource- and action-based conditions</a> in the <i>Health User Guide</i>.</p> </li>
/// </ul>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeAffectedEntitiesForOrganization<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_affected_entities_for_organization_input::Builder,
}
impl<C, M, R> DescribeAffectedEntitiesForOrganization<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeAffectedEntitiesForOrganization`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeAffectedEntitiesForOrganizationOutput,
aws_smithy_http::result::SdkError<
crate::error::DescribeAffectedEntitiesForOrganizationError,
>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeAffectedEntitiesForOrganizationInputOperationOutputAlias,
crate::output::DescribeAffectedEntitiesForOrganizationOutput,
crate::error::DescribeAffectedEntitiesForOrganizationError,
crate::input::DescribeAffectedEntitiesForOrganizationInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeAffectedEntitiesForOrganizationPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(
self,
) -> crate::paginator::DescribeAffectedEntitiesForOrganizationPaginator<C, M, R> {
crate::paginator::DescribeAffectedEntitiesForOrganizationPaginator::new(
self.handle,
self.inner,
)
}
/// Appends an item to `organizationEntityFilters`.
///
/// To override the contents of this collection use [`set_organization_entity_filters`](Self::set_organization_entity_filters).
///
/// <p>A JSON set of elements including the <code>awsAccountId</code> and the <code>eventArn</code>.</p>
pub fn organization_entity_filters(
mut self,
input: crate::model::EventAccountFilter,
) -> Self {
self.inner = self.inner.organization_entity_filters(input);
self
}
/// <p>A JSON set of elements including the <code>awsAccountId</code> and the <code>eventArn</code>.</p>
pub fn set_organization_entity_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::EventAccountFilter>>,
) -> Self {
self.inner = self.inner.set_organization_entity_filters(input);
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn locale(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.locale(input.into());
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn set_locale(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_locale(input);
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
}
/// Fluent builder constructing a request to `DescribeEntityAggregates`.
///
/// <p>Returns the number of entities that are affected by each of the specified events.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeEntityAggregates<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_entity_aggregates_input::Builder,
}
impl<C, M, R> DescribeEntityAggregates<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeEntityAggregates`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeEntityAggregatesOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeEntityAggregatesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeEntityAggregatesInputOperationOutputAlias,
crate::output::DescribeEntityAggregatesOutput,
crate::error::DescribeEntityAggregatesError,
crate::input::DescribeEntityAggregatesInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `eventArns`.
///
/// To override the contents of this collection use [`set_event_arns`](Self::set_event_arns).
///
/// <p>A list of event ARNs (unique identifiers). For example: <code>"arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-CDE456", "arn:aws:health:us-west-1::event/EBS/AWS_EBS_LOST_VOLUME/AWS_EBS_LOST_VOLUME_CHI789_JKL101"</code> </p>
pub fn event_arns(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.event_arns(input.into());
self
}
/// <p>A list of event ARNs (unique identifiers). For example: <code>"arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-CDE456", "arn:aws:health:us-west-1::event/EBS/AWS_EBS_LOST_VOLUME/AWS_EBS_LOST_VOLUME_CHI789_JKL101"</code> </p>
pub fn set_event_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_event_arns(input);
self
}
}
/// Fluent builder constructing a request to `DescribeEventAggregates`.
///
/// <p>Returns the number of events of each event type (issue, scheduled change, and account notification). If no filter is specified, the counts of all events in each category are returned.</p> <note>
/// <p>This API operation uses pagination. Specify the <code>nextToken</code> parameter in the next request to return more results.</p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeEventAggregates<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_event_aggregates_input::Builder,
}
impl<C, M, R> DescribeEventAggregates<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeEventAggregates`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeEventAggregatesOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeEventAggregatesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeEventAggregatesInputOperationOutputAlias,
crate::output::DescribeEventAggregatesOutput,
crate::error::DescribeEventAggregatesError,
crate::input::DescribeEventAggregatesInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeEventAggregatesPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::DescribeEventAggregatesPaginator<C, M, R> {
crate::paginator::DescribeEventAggregatesPaginator::new(self.handle, self.inner)
}
/// <p>Values to narrow the results returned.</p>
pub fn filter(mut self, input: crate::model::EventFilter) -> Self {
self.inner = self.inner.filter(input);
self
}
/// <p>Values to narrow the results returned.</p>
pub fn set_filter(mut self, input: std::option::Option<crate::model::EventFilter>) -> Self {
self.inner = self.inner.set_filter(input);
self
}
/// <p>The only currently supported value is <code>eventTypeCategory</code>.</p>
pub fn aggregate_field(mut self, input: crate::model::EventAggregateField) -> Self {
self.inner = self.inner.aggregate_field(input);
self
}
/// <p>The only currently supported value is <code>eventTypeCategory</code>.</p>
pub fn set_aggregate_field(
mut self,
input: std::option::Option<crate::model::EventAggregateField>,
) -> Self {
self.inner = self.inner.set_aggregate_field(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
}
/// Fluent builder constructing a request to `DescribeEventDetails`.
///
/// <p>Returns detailed information about one or more specified events. Information includes standard event data (Amazon Web Services Region, service, and so on, as returned by <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeEvents.html">DescribeEvents</a>), a detailed event description, and possible additional metadata that depends upon the nature of the event. Affected entities are not included. To retrieve the entities, use the <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeAffectedEntities.html">DescribeAffectedEntities</a> operation.</p>
/// <p>If a specified event can't be retrieved, an error message is returned for that event.</p> <note>
/// <p>This operation supports resource-level permissions. You can use this operation to allow or deny access to specific Health events. For more information, see <a href="https://docs.aws.amazon.com/health/latest/ug/security_iam_id-based-policy-examples.html#resource-action-based-conditions">Resource- and action-based conditions</a> in the <i>Health User Guide</i>.</p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeEventDetails<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_event_details_input::Builder,
}
impl<C, M, R> DescribeEventDetails<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeEventDetails`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeEventDetailsOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeEventDetailsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeEventDetailsInputOperationOutputAlias,
crate::output::DescribeEventDetailsOutput,
crate::error::DescribeEventDetailsError,
crate::input::DescribeEventDetailsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `eventArns`.
///
/// To override the contents of this collection use [`set_event_arns`](Self::set_event_arns).
///
/// <p>A list of event ARNs (unique identifiers). For example: <code>"arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-CDE456", "arn:aws:health:us-west-1::event/EBS/AWS_EBS_LOST_VOLUME/AWS_EBS_LOST_VOLUME_CHI789_JKL101"</code> </p>
pub fn event_arns(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.event_arns(input.into());
self
}
/// <p>A list of event ARNs (unique identifiers). For example: <code>"arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-CDE456", "arn:aws:health:us-west-1::event/EBS/AWS_EBS_LOST_VOLUME/AWS_EBS_LOST_VOLUME_CHI789_JKL101"</code> </p>
pub fn set_event_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_event_arns(input);
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn locale(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.locale(input.into());
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn set_locale(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_locale(input);
self
}
}
/// Fluent builder constructing a request to `DescribeEventDetailsForOrganization`.
///
/// <p>Returns detailed information about one or more specified events for one or more Amazon Web Services accounts in your organization. This information includes standard event data (such as the Amazon Web Services Region and service), an event description, and (depending on the event) possible metadata. This operation doesn't return affected entities, such as the resources related to the event. To return affected entities, use the <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeAffectedEntitiesForOrganization.html">DescribeAffectedEntitiesForOrganization</a> operation.</p> <note>
/// <p>Before you can call this operation, you must first enable Health to work with Organizations. To do this, call the <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_EnableHealthServiceAccessForOrganization.html">EnableHealthServiceAccessForOrganization</a> operation from your organization's management account.</p>
/// </note>
/// <p>When you call the <code>DescribeEventDetailsForOrganization</code> operation, specify the <code>organizationEventDetailFilters</code> object in the request. Depending on the Health event type, note the following differences:</p>
/// <ul>
/// <li> <p>To return event details for a public event, you must specify a null value for the <code>awsAccountId</code> parameter. If you specify an account ID for a public event, Health returns an error message because public events aren't specific to an account.</p> </li>
/// <li> <p>To return event details for an event that is specific to an account in your organization, you must specify the <code>awsAccountId</code> parameter in the request. If you don't specify an account ID, Health returns an error message because the event is specific to an account in your organization. </p> </li>
/// </ul>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_Event.html">Event</a>.</p> <note>
/// <p>This operation doesn't support resource-level permissions. You can't use this operation to allow or deny access to specific Health events. For more information, see <a href="https://docs.aws.amazon.com/health/latest/ug/security_iam_id-based-policy-examples.html#resource-action-based-conditions">Resource- and action-based conditions</a> in the <i>Health User Guide</i>.</p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeEventDetailsForOrganization<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_event_details_for_organization_input::Builder,
}
impl<C, M, R> DescribeEventDetailsForOrganization<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeEventDetailsForOrganization`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeEventDetailsForOrganizationOutput,
aws_smithy_http::result::SdkError<
crate::error::DescribeEventDetailsForOrganizationError,
>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeEventDetailsForOrganizationInputOperationOutputAlias,
crate::output::DescribeEventDetailsForOrganizationOutput,
crate::error::DescribeEventDetailsForOrganizationError,
crate::input::DescribeEventDetailsForOrganizationInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `organizationEventDetailFilters`.
///
/// To override the contents of this collection use [`set_organization_event_detail_filters`](Self::set_organization_event_detail_filters).
///
/// <p>A set of JSON elements that includes the <code>awsAccountId</code> and the <code>eventArn</code>.</p>
pub fn organization_event_detail_filters(
mut self,
input: crate::model::EventAccountFilter,
) -> Self {
self.inner = self.inner.organization_event_detail_filters(input);
self
}
/// <p>A set of JSON elements that includes the <code>awsAccountId</code> and the <code>eventArn</code>.</p>
pub fn set_organization_event_detail_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::EventAccountFilter>>,
) -> Self {
self.inner = self.inner.set_organization_event_detail_filters(input);
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn locale(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.locale(input.into());
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn set_locale(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_locale(input);
self
}
}
/// Fluent builder constructing a request to `DescribeEvents`.
///
/// <p> Returns information about events that meet the specified filter criteria. Events are returned in a summary form and do not include the detailed description, any additional metadata that depends on the event type, or any affected resources. To retrieve that information, use the <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeEventDetails.html">DescribeEventDetails</a> and <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeAffectedEntities.html">DescribeAffectedEntities</a> operations.</p>
/// <p>If no filter criteria are specified, all events are returned. Results are sorted by <code>lastModifiedTime</code>, starting with the most recent event.</p> <note>
/// <ul>
/// <li> <p>When you call the <code>DescribeEvents</code> operation and specify an entity for the <code>entityValues</code> parameter, Health might return public events that aren't specific to that resource. For example, if you call <code>DescribeEvents</code> and specify an ID for an Amazon Elastic Compute Cloud (Amazon EC2) instance, Health might return events that aren't specific to that resource or service. To get events that are specific to a service, use the <code>services</code> parameter in the <code>filter</code> object. For more information, see <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_Event.html">Event</a>.</p> </li>
/// <li> <p>This API operation uses pagination. Specify the <code>nextToken</code> parameter in the next request to return more results.</p> </li>
/// </ul>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeEvents<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_events_input::Builder,
}
impl<C, M, R> DescribeEvents<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeEvents`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeEventsOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeEventsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeEventsInputOperationOutputAlias,
crate::output::DescribeEventsOutput,
crate::error::DescribeEventsError,
crate::input::DescribeEventsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeEventsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::DescribeEventsPaginator<C, M, R> {
crate::paginator::DescribeEventsPaginator::new(self.handle, self.inner)
}
/// <p>Values to narrow the results returned.</p>
pub fn filter(mut self, input: crate::model::EventFilter) -> Self {
self.inner = self.inner.filter(input);
self
}
/// <p>Values to narrow the results returned.</p>
pub fn set_filter(mut self, input: std::option::Option<crate::model::EventFilter>) -> Self {
self.inner = self.inner.set_filter(input);
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn locale(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.locale(input.into());
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn set_locale(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_locale(input);
self
}
}
/// Fluent builder constructing a request to `DescribeEventsForOrganization`.
///
/// <p>Returns information about events across your organization in Organizations. You can use the<code>filters</code> parameter to specify the events that you want to return. Events are returned in a summary form and don't include the affected accounts, detailed description, any additional metadata that depends on the event type, or any affected resources. To retrieve that information, use the following operations:</p>
/// <ul>
/// <li> <p> <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeAffectedAccountsForOrganization.html">DescribeAffectedAccountsForOrganization</a> </p> </li>
/// <li> <p> <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeEventDetailsForOrganization.html">DescribeEventDetailsForOrganization</a> </p> </li>
/// <li> <p> <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeAffectedEntitiesForOrganization.html">DescribeAffectedEntitiesForOrganization</a> </p> </li>
/// </ul>
/// <p>If you don't specify a <code>filter</code>, the <code>DescribeEventsForOrganizations</code> returns all events across your organization. Results are sorted by <code>lastModifiedTime</code>, starting with the most recent event. </p>
/// <p>For more information about the different types of Health events, see <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_Event.html">Event</a>.</p>
/// <p>Before you can call this operation, you must first enable Health to work with Organizations. To do this, call the <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_EnableHealthServiceAccessForOrganization.html">EnableHealthServiceAccessForOrganization</a> operation from your organization's management account.</p> <note>
/// <p>This API operation uses pagination. Specify the <code>nextToken</code> parameter in the next request to return more results.</p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeEventsForOrganization<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_events_for_organization_input::Builder,
}
impl<C, M, R> DescribeEventsForOrganization<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeEventsForOrganization`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeEventsForOrganizationOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeEventsForOrganizationError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeEventsForOrganizationInputOperationOutputAlias,
crate::output::DescribeEventsForOrganizationOutput,
crate::error::DescribeEventsForOrganizationError,
crate::input::DescribeEventsForOrganizationInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeEventsForOrganizationPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(
self,
) -> crate::paginator::DescribeEventsForOrganizationPaginator<C, M, R> {
crate::paginator::DescribeEventsForOrganizationPaginator::new(self.handle, self.inner)
}
/// <p>Values to narrow the results returned.</p>
pub fn filter(mut self, input: crate::model::OrganizationEventFilter) -> Self {
self.inner = self.inner.filter(input);
self
}
/// <p>Values to narrow the results returned.</p>
pub fn set_filter(
mut self,
input: std::option::Option<crate::model::OrganizationEventFilter>,
) -> Self {
self.inner = self.inner.set_filter(input);
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn locale(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.locale(input.into());
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn set_locale(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_locale(input);
self
}
}
/// Fluent builder constructing a request to `DescribeEventTypes`.
///
/// <p>Returns the event types that meet the specified filter criteria. You can use this API operation to find information about the Health event, such as the category, Amazon Web Services service, and event code. The metadata for each event appears in the <a href="https://docs.aws.amazon.com/health/latest/APIReference/API_EventType.html">EventType</a> object. </p>
/// <p>If you don't specify a filter criteria, the API operation returns all event types, in no particular order. </p> <note>
/// <p>This API operation uses pagination. Specify the <code>nextToken</code> parameter in the next request to return more results.</p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeEventTypes<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_event_types_input::Builder,
}
impl<C, M, R> DescribeEventTypes<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeEventTypes`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeEventTypesOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeEventTypesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeEventTypesInputOperationOutputAlias,
crate::output::DescribeEventTypesOutput,
crate::error::DescribeEventTypesError,
crate::input::DescribeEventTypesInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeEventTypesPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::DescribeEventTypesPaginator<C, M, R> {
crate::paginator::DescribeEventTypesPaginator::new(self.handle, self.inner)
}
/// <p>Values to narrow the results returned.</p>
pub fn filter(mut self, input: crate::model::EventTypeFilter) -> Self {
self.inner = self.inner.filter(input);
self
}
/// <p>Values to narrow the results returned.</p>
pub fn set_filter(
mut self,
input: std::option::Option<crate::model::EventTypeFilter>,
) -> Self {
self.inner = self.inner.set_filter(input);
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn locale(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.locale(input.into());
self
}
/// <p>The locale (language) to return information in. English (en) is the default and the only supported value at this time.</p>
pub fn set_locale(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_locale(input);
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
}
/// Fluent builder constructing a request to `DescribeHealthServiceStatusForOrganization`.
///
/// <p>This operation provides status information on enabling or disabling Health to work with your organization. To call this operation, you must sign in as an IAM user, assume an IAM role, or sign in as the root user (not recommended) in the organization's management account.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeHealthServiceStatusForOrganization<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_health_service_status_for_organization_input::Builder,
}
impl<C, M, R> DescribeHealthServiceStatusForOrganization<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeHealthServiceStatusForOrganization`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeHealthServiceStatusForOrganizationOutput,
aws_smithy_http::result::SdkError<
crate::error::DescribeHealthServiceStatusForOrganizationError,
>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeHealthServiceStatusForOrganizationInputOperationOutputAlias,
crate::output::DescribeHealthServiceStatusForOrganizationOutput,
crate::error::DescribeHealthServiceStatusForOrganizationError,
crate::input::DescribeHealthServiceStatusForOrganizationInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
}
/// Fluent builder constructing a request to `DisableHealthServiceAccessForOrganization`.
///
/// <p>Disables Health from working with Organizations. To call this operation, you must sign in as an Identity and Access Management (IAM) user, assume an IAM role, or sign in as the root user (not recommended) in the organization's management account. For more information, see <a href="https://docs.aws.amazon.com/health/latest/ug/aggregate-events.html">Aggregating Health events</a> in the <i>Health User Guide</i>.</p>
/// <p>This operation doesn't remove the service-linked role from the management account in your organization. You must use the IAM console, API, or Command Line Interface (CLI) to remove the service-linked role. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#delete-service-linked-role">Deleting a Service-Linked Role</a> in the <i>IAM User Guide</i>.</p> <note>
/// <p>You can also disable the organizational feature by using the Organizations <a href="https://docs.aws.amazon.com/organizations/latest/APIReference/API_DisableAWSServiceAccess.html">DisableAWSServiceAccess</a> API operation. After you call this operation, Health stops aggregating events for all other Amazon Web Services accounts in your organization. If you call the Health API operations for organizational view, Health returns an error. Health continues to aggregate health events for your Amazon Web Services account.</p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DisableHealthServiceAccessForOrganization<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::disable_health_service_access_for_organization_input::Builder,
}
impl<C, M, R> DisableHealthServiceAccessForOrganization<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DisableHealthServiceAccessForOrganization`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DisableHealthServiceAccessForOrganizationOutput,
aws_smithy_http::result::SdkError<
crate::error::DisableHealthServiceAccessForOrganizationError,
>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DisableHealthServiceAccessForOrganizationInputOperationOutputAlias,
crate::output::DisableHealthServiceAccessForOrganizationOutput,
crate::error::DisableHealthServiceAccessForOrganizationError,
crate::input::DisableHealthServiceAccessForOrganizationInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
}
/// Fluent builder constructing a request to `EnableHealthServiceAccessForOrganization`.
///
/// <p>Enables Health to work with Organizations. You can use the organizational view feature to aggregate events from all Amazon Web Services accounts in your organization in a centralized location. </p>
/// <p>This operation also creates a service-linked role for the management account in the organization. </p> <note>
/// <p>To call this operation, you must meet the following requirements:</p>
/// <ul>
/// <li> <p>You must have a Business, Enterprise On-Ramp, or Enterprise Support plan from <a href="http://aws.amazon.com/premiumsupport/">Amazon Web Services Support</a> to use the Health API. If you call the Health API from an Amazon Web Services account that doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, you receive a <code>SubscriptionRequiredException</code> error.</p> </li>
/// <li> <p>You must have permission to call this operation from the organization's management account. For example IAM policies, see <a href="https://docs.aws.amazon.com/health/latest/ug/security_iam_id-based-policy-examples.html">Health identity-based policy examples</a>.</p> </li>
/// </ul>
/// </note>
/// <p>If you don't have the required support plan, you can instead use the Health console to enable the organizational view feature. For more information, see <a href="https://docs.aws.amazon.com/health/latest/ug/aggregate-events.html">Aggregating Health events</a> in the <i>Health User Guide</i>.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct EnableHealthServiceAccessForOrganization<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::enable_health_service_access_for_organization_input::Builder,
}
impl<C, M, R> EnableHealthServiceAccessForOrganization<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `EnableHealthServiceAccessForOrganization`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::EnableHealthServiceAccessForOrganizationOutput,
aws_smithy_http::result::SdkError<
crate::error::EnableHealthServiceAccessForOrganizationError,
>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::EnableHealthServiceAccessForOrganizationInputOperationOutputAlias,
crate::output::EnableHealthServiceAccessForOrganizationOutput,
crate::error::EnableHealthServiceAccessForOrganizationError,
crate::input::EnableHealthServiceAccessForOrganizationInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
}
}
impl<C> Client<C, crate::middleware::DefaultMiddleware, aws_smithy_client::retry::Standard> {
/// Creates a client with the given service config and connector override.
pub fn from_conf_conn(conf: crate::Config, conn: C) -> Self {
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let timeout_config = conf.timeout_config.as_ref().cloned().unwrap_or_default();
let sleep_impl = conf.sleep_impl.clone();
let mut builder = aws_smithy_client::Builder::new()
.connector(conn)
.middleware(crate::middleware::DefaultMiddleware::new());
builder.set_retry_config(retry_config.into());
builder.set_timeout_config(timeout_config);
if let Some(sleep_impl) = sleep_impl {
builder.set_sleep_impl(Some(sleep_impl));
}
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}
impl
Client<
aws_smithy_client::erase::DynConnector,
crate::middleware::DefaultMiddleware,
aws_smithy_client::retry::Standard,
>
{
/// Creates a new client from a shared config.
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn new(config: &aws_types::config::Config) -> Self {
Self::from_conf(config.into())
}
/// Creates a new client from the service [`Config`](crate::Config).
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn from_conf(conf: crate::Config) -> Self {
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let timeout_config = conf.timeout_config.as_ref().cloned().unwrap_or_default();
let sleep_impl = conf.sleep_impl.clone();
let mut builder = aws_smithy_client::Builder::dyn_https()
.middleware(crate::middleware::DefaultMiddleware::new());
builder.set_retry_config(retry_config.into());
builder.set_timeout_config(timeout_config);
// the builder maintains a try-state. To avoid suppressing the warning when sleep is unset,
// only set it if we actually have a sleep impl.
if let Some(sleep_impl) = sleep_impl {
builder.set_sleep_impl(Some(sleep_impl));
}
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}