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 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955
// 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 Resource Groups
///
/// Client for invoking operations on AWS Resource Groups. Each operation on AWS Resource Groups 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_resourcegroups::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_resourcegroups::config::Builder::from(&shared_config)
/// .retry_config(RetryConfig::disabled())
/// .build();
/// let client = aws_sdk_resourcegroups::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 [`CreateGroup`](crate::client::fluent_builders::CreateGroup) operation.
///
/// - The fluent builder is configurable:
/// - [`name(impl Into<String>)`](crate::client::fluent_builders::CreateGroup::name) / [`set_name(Option<String>)`](crate::client::fluent_builders::CreateGroup::set_name): <p>The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with <code>AWS</code> or <code>aws</code>; these are reserved. A resource group name must be unique within each AWS Region in your AWS account.</p>
/// - [`description(impl Into<String>)`](crate::client::fluent_builders::CreateGroup::description) / [`set_description(Option<String>)`](crate::client::fluent_builders::CreateGroup::set_description): <p>The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.</p>
/// - [`resource_query(ResourceQuery)`](crate::client::fluent_builders::CreateGroup::resource_query) / [`set_resource_query(Option<ResourceQuery>)`](crate::client::fluent_builders::CreateGroup::set_resource_query): <p>The resource query that determines which AWS resources are members of this group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>. </p> <note> <p>A resource group can contain either a <code>ResourceQuery</code> or a <code>Configuration</code>, but not both.</p> </note>
/// - [`tags(HashMap<String, String>)`](crate::client::fluent_builders::CreateGroup::tags) / [`set_tags(Option<HashMap<String, String>>)`](crate::client::fluent_builders::CreateGroup::set_tags): <p>The tags to add to the group. A tag is key-value pair string.</p>
/// - [`configuration(Vec<GroupConfigurationItem>)`](crate::client::fluent_builders::CreateGroup::configuration) / [`set_configuration(Option<Vec<GroupConfigurationItem>>)`](crate::client::fluent_builders::CreateGroup::set_configuration): <p>A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements. For details about the syntax of service configurations, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for resource groups</a>.</p> <note> <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p> </note>
/// - On success, responds with [`CreateGroupOutput`](crate::output::CreateGroupOutput) with field(s):
/// - [`group(Option<Group>)`](crate::output::CreateGroupOutput::group): <p>The description of the resource group.</p>
/// - [`resource_query(Option<ResourceQuery>)`](crate::output::CreateGroupOutput::resource_query): <p>The resource query associated with the group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>. </p>
/// - [`tags(Option<HashMap<String, String>>)`](crate::output::CreateGroupOutput::tags): <p>The tags associated with the group.</p>
/// - [`group_configuration(Option<GroupConfiguration>)`](crate::output::CreateGroupOutput::group_configuration): <p>The service configuration associated with the resource group. For details about the syntax of a service configuration, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for resource groups</a>.</p>
/// - On failure, responds with [`SdkError<CreateGroupError>`](crate::error::CreateGroupError)
pub fn create_group(&self) -> fluent_builders::CreateGroup<C, M, R> {
fluent_builders::CreateGroup::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DeleteGroup`](crate::client::fluent_builders::DeleteGroup) operation.
///
/// - The fluent builder is configurable:
/// - [`group_name(impl Into<String>)`](crate::client::fluent_builders::DeleteGroup::group_name) / [`set_group_name(Option<String>)`](crate::client::fluent_builders::DeleteGroup::set_group_name): <p>Deprecated - don't use this parameter. Use <code>Group</code> instead.</p>
/// - [`group(impl Into<String>)`](crate::client::fluent_builders::DeleteGroup::group) / [`set_group(Option<String>)`](crate::client::fluent_builders::DeleteGroup::set_group): <p>The name or the ARN of the resource group to delete.</p>
/// - On success, responds with [`DeleteGroupOutput`](crate::output::DeleteGroupOutput) with field(s):
/// - [`group(Option<Group>)`](crate::output::DeleteGroupOutput::group): <p>A full description of the deleted resource group.</p>
/// - On failure, responds with [`SdkError<DeleteGroupError>`](crate::error::DeleteGroupError)
pub fn delete_group(&self) -> fluent_builders::DeleteGroup<C, M, R> {
fluent_builders::DeleteGroup::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetGroup`](crate::client::fluent_builders::GetGroup) operation.
///
/// - The fluent builder is configurable:
/// - [`group_name(impl Into<String>)`](crate::client::fluent_builders::GetGroup::group_name) / [`set_group_name(Option<String>)`](crate::client::fluent_builders::GetGroup::set_group_name): <p>Deprecated - don't use this parameter. Use <code>Group</code> instead.</p>
/// - [`group(impl Into<String>)`](crate::client::fluent_builders::GetGroup::group) / [`set_group(Option<String>)`](crate::client::fluent_builders::GetGroup::set_group): <p>The name or the ARN of the resource group to retrieve.</p>
/// - On success, responds with [`GetGroupOutput`](crate::output::GetGroupOutput) with field(s):
/// - [`group(Option<Group>)`](crate::output::GetGroupOutput::group): <p>A full description of the resource group.</p>
/// - On failure, responds with [`SdkError<GetGroupError>`](crate::error::GetGroupError)
pub fn get_group(&self) -> fluent_builders::GetGroup<C, M, R> {
fluent_builders::GetGroup::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetGroupConfiguration`](crate::client::fluent_builders::GetGroupConfiguration) operation.
///
/// - The fluent builder is configurable:
/// - [`group(impl Into<String>)`](crate::client::fluent_builders::GetGroupConfiguration::group) / [`set_group(Option<String>)`](crate::client::fluent_builders::GetGroupConfiguration::set_group): <p>The name or the ARN of the resource group.</p>
/// - On success, responds with [`GetGroupConfigurationOutput`](crate::output::GetGroupConfigurationOutput) with field(s):
/// - [`group_configuration(Option<GroupConfiguration>)`](crate::output::GetGroupConfigurationOutput::group_configuration): <p>The service configuration associated with the specified group. For details about the service configuration syntax, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for resource groups</a>.</p>
/// - On failure, responds with [`SdkError<GetGroupConfigurationError>`](crate::error::GetGroupConfigurationError)
pub fn get_group_configuration(&self) -> fluent_builders::GetGroupConfiguration<C, M, R> {
fluent_builders::GetGroupConfiguration::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetGroupQuery`](crate::client::fluent_builders::GetGroupQuery) operation.
///
/// - The fluent builder is configurable:
/// - [`group_name(impl Into<String>)`](crate::client::fluent_builders::GetGroupQuery::group_name) / [`set_group_name(Option<String>)`](crate::client::fluent_builders::GetGroupQuery::set_group_name): <p>Don't use this parameter. Use <code>Group</code> instead.</p>
/// - [`group(impl Into<String>)`](crate::client::fluent_builders::GetGroupQuery::group) / [`set_group(Option<String>)`](crate::client::fluent_builders::GetGroupQuery::set_group): <p>The name or the ARN of the resource group to query.</p>
/// - On success, responds with [`GetGroupQueryOutput`](crate::output::GetGroupQueryOutput) with field(s):
/// - [`group_query(Option<GroupQuery>)`](crate::output::GetGroupQueryOutput::group_query): <p>The resource query associated with the specified group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>.</p>
/// - On failure, responds with [`SdkError<GetGroupQueryError>`](crate::error::GetGroupQueryError)
pub fn get_group_query(&self) -> fluent_builders::GetGroupQuery<C, M, R> {
fluent_builders::GetGroupQuery::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetTags`](crate::client::fluent_builders::GetTags) operation.
///
/// - The fluent builder is configurable:
/// - [`arn(impl Into<String>)`](crate::client::fluent_builders::GetTags::arn) / [`set_arn(Option<String>)`](crate::client::fluent_builders::GetTags::set_arn): <p>The ARN of the resource group whose tags you want to retrieve.</p>
/// - On success, responds with [`GetTagsOutput`](crate::output::GetTagsOutput) with field(s):
/// - [`arn(Option<String>)`](crate::output::GetTagsOutput::arn): <p>The ARN of the tagged resource group.</p>
/// - [`tags(Option<HashMap<String, String>>)`](crate::output::GetTagsOutput::tags): <p>The tags associated with the specified resource group.</p>
/// - On failure, responds with [`SdkError<GetTagsError>`](crate::error::GetTagsError)
pub fn get_tags(&self) -> fluent_builders::GetTags<C, M, R> {
fluent_builders::GetTags::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GroupResources`](crate::client::fluent_builders::GroupResources) operation.
///
/// - The fluent builder is configurable:
/// - [`group(impl Into<String>)`](crate::client::fluent_builders::GroupResources::group) / [`set_group(Option<String>)`](crate::client::fluent_builders::GroupResources::set_group): <p>The name or the ARN of the resource group to add resources to.</p>
/// - [`resource_arns(Vec<String>)`](crate::client::fluent_builders::GroupResources::resource_arns) / [`set_resource_arns(Option<Vec<String>>)`](crate::client::fluent_builders::GroupResources::set_resource_arns): <p>The list of ARNs for resources to be added to the group. </p>
/// - On success, responds with [`GroupResourcesOutput`](crate::output::GroupResourcesOutput) with field(s):
/// - [`succeeded(Option<Vec<String>>)`](crate::output::GroupResourcesOutput::succeeded): <p>A list of ARNs of resources that were successfully added to the group by this operation.</p>
/// - [`failed(Option<Vec<FailedResource>>)`](crate::output::GroupResourcesOutput::failed): <p>A list of ARNs of any resources that failed to be added to the group by this operation.</p>
/// - [`pending(Option<Vec<PendingResource>>)`](crate::output::GroupResourcesOutput::pending): <p>A list of ARNs of any resources that are still in the process of being added to the group by this operation. These pending additions continue asynchronously. You can check the status of pending additions by using the <code> <code>ListGroupResources</code> </code> operation, and checking the <code>Resources</code> array in the response and the <code>Status</code> field of each object in that array. </p>
/// - On failure, responds with [`SdkError<GroupResourcesError>`](crate::error::GroupResourcesError)
pub fn group_resources(&self) -> fluent_builders::GroupResources<C, M, R> {
fluent_builders::GroupResources::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListGroupResources`](crate::client::fluent_builders::ListGroupResources) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::ListGroupResources::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`group_name(impl Into<String>)`](crate::client::fluent_builders::ListGroupResources::group_name) / [`set_group_name(Option<String>)`](crate::client::fluent_builders::ListGroupResources::set_group_name): <important> <p> <i> <b>Deprecated - don't use this parameter. Use the <code>Group</code> request field instead.</b> </i> </p> </important>
/// - [`group(impl Into<String>)`](crate::client::fluent_builders::ListGroupResources::group) / [`set_group(Option<String>)`](crate::client::fluent_builders::ListGroupResources::set_group): <p>The name or the ARN of the resource group</p>
/// - [`filters(Vec<ResourceFilter>)`](crate::client::fluent_builders::ListGroupResources::filters) / [`set_filters(Option<Vec<ResourceFilter>>)`](crate::client::fluent_builders::ListGroupResources::set_filters): <p>Filters, formatted as <code>ResourceFilter</code> objects, that you want to apply to a <code>ListGroupResources</code> operation. Filters the results to include only those of the specified resource types.</p> <ul> <li> <p> <code>resource-type</code> - Filter resources by their type. Specify up to five resource types in the format <code>AWS::ServiceCode::ResourceType</code>. For example, <code>AWS::EC2::Instance</code>, or <code>AWS::S3::Bucket</code>. </p> </li> </ul> <p>When you specify a <code>resource-type</code> filter for <code>ListGroupResources</code>, AWS Resource Groups validates your filter resource types against the types that are defined in the query associated with the group. For example, if a group contains only S3 buckets because its query specifies only that resource type, but your <code>resource-type</code> filter includes EC2 instances, AWS Resource Groups does not filter for EC2 instances. In this case, a <code>ListGroupResources</code> request returns a <code>BadRequestException</code> error with a message similar to the following:</p> <p> <code>The resource types specified as filters in the request are not valid.</code> </p> <p>The error includes a list of resource types that failed the validation because they are not part of the query associated with the group. This validation doesn't occur when the group query specifies <code>AWS::AllSupported</code>, because a group based on such a query can contain any of the allowed resource types for the query type (tag-based or AWS CloudFormation stack-based queries).</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::ListGroupResources::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::ListGroupResources::set_max_results): <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::ListGroupResources::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::ListGroupResources::set_next_token): <p>The parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</p>
/// - On success, responds with [`ListGroupResourcesOutput`](crate::output::ListGroupResourcesOutput) with field(s):
/// - [`resources(Option<Vec<ListGroupResourcesItem>>)`](crate::output::ListGroupResourcesOutput::resources): <p>An array of resources from which you can determine each resource's identity, type, and group membership status.</p>
/// - [`resource_identifiers(Option<Vec<ResourceIdentifier>>)`](crate::output::ListGroupResourcesOutput::resource_identifiers): <important> <p> <b> <i>Deprecated - don't use this parameter. Use the <code>Resources</code> response field instead.</i> </b> </p> </important>
/// - [`next_token(Option<String>)`](crate::output::ListGroupResourcesOutput::next_token): <p>If present, indicates that more output is available than is included in the current response. Use this value in the <code>NextToken</code> request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the <code>NextToken</code> response element comes back as <code>null</code>.</p>
/// - [`query_errors(Option<Vec<QueryError>>)`](crate::output::ListGroupResourcesOutput::query_errors): <p>A list of <code>QueryError</code> objects. Each error is an object that contains <code>ErrorCode</code> and <code>Message</code> structures. Possible values for <code>ErrorCode</code> are <code>CLOUDFORMATION_STACK_INACTIVE</code> and <code>CLOUDFORMATION_STACK_NOT_EXISTING</code>.</p>
/// - On failure, responds with [`SdkError<ListGroupResourcesError>`](crate::error::ListGroupResourcesError)
pub fn list_group_resources(&self) -> fluent_builders::ListGroupResources<C, M, R> {
fluent_builders::ListGroupResources::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListGroups`](crate::client::fluent_builders::ListGroups) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::ListGroups::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`filters(Vec<GroupFilter>)`](crate::client::fluent_builders::ListGroups::filters) / [`set_filters(Option<Vec<GroupFilter>>)`](crate::client::fluent_builders::ListGroups::set_filters): <p>Filters, formatted as <code>GroupFilter</code> objects, that you want to apply to a <code>ListGroups</code> operation.</p> <ul> <li> <p> <code>resource-type</code> - Filter the results to include only those of the specified resource types. Specify up to five resource types in the format <code>AWS::<i>ServiceCode</i>::<i>ResourceType</i> </code>. For example, <code>AWS::EC2::Instance</code>, or <code>AWS::S3::Bucket</code>.</p> </li> <li> <p> <code>configuration-type</code> - Filter the results to include only those groups that have the specified configuration types attached. The current supported values are:</p> <ul> <li> <p> <code>AWS:EC2::CapacityReservationPool</code> </p> </li> <li> <p> <code>AWS:EC2::HostManagement</code> </p> </li> </ul> </li> </ul>
/// - [`max_results(i32)`](crate::client::fluent_builders::ListGroups::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::ListGroups::set_max_results): <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::ListGroups::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::ListGroups::set_next_token): <p>The parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</p>
/// - On success, responds with [`ListGroupsOutput`](crate::output::ListGroupsOutput) with field(s):
/// - [`group_identifiers(Option<Vec<GroupIdentifier>>)`](crate::output::ListGroupsOutput::group_identifiers): <p>A list of <code>GroupIdentifier</code> objects. Each identifier is an object that contains both the <code>Name</code> and the <code>GroupArn</code>.</p>
/// - [`groups(Option<Vec<Group>>)`](crate::output::ListGroupsOutput::groups): <important> <p> <i> <b>Deprecated - don't use this field. Use the <code>GroupIdentifiers</code> response field instead.</b> </i> </p> </important>
/// - [`next_token(Option<String>)`](crate::output::ListGroupsOutput::next_token): <p>If present, indicates that more output is available than is included in the current response. Use this value in the <code>NextToken</code> request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the <code>NextToken</code> response element comes back as <code>null</code>.</p>
/// - On failure, responds with [`SdkError<ListGroupsError>`](crate::error::ListGroupsError)
pub fn list_groups(&self) -> fluent_builders::ListGroups<C, M, R> {
fluent_builders::ListGroups::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`PutGroupConfiguration`](crate::client::fluent_builders::PutGroupConfiguration) operation.
///
/// - The fluent builder is configurable:
/// - [`group(impl Into<String>)`](crate::client::fluent_builders::PutGroupConfiguration::group) / [`set_group(Option<String>)`](crate::client::fluent_builders::PutGroupConfiguration::set_group): <p>The name or ARN of the resource group with the configuration that you want to update.</p>
/// - [`configuration(Vec<GroupConfigurationItem>)`](crate::client::fluent_builders::PutGroupConfiguration::configuration) / [`set_configuration(Option<Vec<GroupConfigurationItem>>)`](crate::client::fluent_builders::PutGroupConfiguration::set_configuration): <p>The new configuration to associate with the specified group. A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements.</p> <p>For information about the syntax of a service configuration, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for resource groups</a>.</p> <note> <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p> </note>
/// - On success, responds with [`PutGroupConfigurationOutput`](crate::output::PutGroupConfigurationOutput)
/// - On failure, responds with [`SdkError<PutGroupConfigurationError>`](crate::error::PutGroupConfigurationError)
pub fn put_group_configuration(&self) -> fluent_builders::PutGroupConfiguration<C, M, R> {
fluent_builders::PutGroupConfiguration::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`SearchResources`](crate::client::fluent_builders::SearchResources) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::SearchResources::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`resource_query(ResourceQuery)`](crate::client::fluent_builders::SearchResources::resource_query) / [`set_resource_query(Option<ResourceQuery>)`](crate::client::fluent_builders::SearchResources::set_resource_query): <p>The search query, using the same formats that are supported for resource group definition. For more information, see <code>CreateGroup</code>.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::SearchResources::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::SearchResources::set_max_results): <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::SearchResources::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::SearchResources::set_next_token): <p>The parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</p>
/// - On success, responds with [`SearchResourcesOutput`](crate::output::SearchResourcesOutput) with field(s):
/// - [`resource_identifiers(Option<Vec<ResourceIdentifier>>)`](crate::output::SearchResourcesOutput::resource_identifiers): <p>The ARNs and resource types of resources that are members of the group that you specified.</p>
/// - [`next_token(Option<String>)`](crate::output::SearchResourcesOutput::next_token): <p>If present, indicates that more output is available than is included in the current response. Use this value in the <code>NextToken</code> request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the <code>NextToken</code> response element comes back as <code>null</code>.</p>
/// - [`query_errors(Option<Vec<QueryError>>)`](crate::output::SearchResourcesOutput::query_errors): <p>A list of <code>QueryError</code> objects. Each error is an object that contains <code>ErrorCode</code> and <code>Message</code> structures. Possible values for <code>ErrorCode</code> are <code>CLOUDFORMATION_STACK_INACTIVE</code> and <code>CLOUDFORMATION_STACK_NOT_EXISTING</code>.</p>
/// - On failure, responds with [`SdkError<SearchResourcesError>`](crate::error::SearchResourcesError)
pub fn search_resources(&self) -> fluent_builders::SearchResources<C, M, R> {
fluent_builders::SearchResources::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`Tag`](crate::client::fluent_builders::Tag) operation.
///
/// - The fluent builder is configurable:
/// - [`arn(impl Into<String>)`](crate::client::fluent_builders::Tag::arn) / [`set_arn(Option<String>)`](crate::client::fluent_builders::Tag::set_arn): <p>The ARN of the resource group to which to add tags.</p>
/// - [`tags(HashMap<String, String>)`](crate::client::fluent_builders::Tag::tags) / [`set_tags(Option<HashMap<String, String>>)`](crate::client::fluent_builders::Tag::set_tags): <p>The tags to add to the specified resource group. A tag is a string-to-string map of key-value pairs.</p>
/// - On success, responds with [`TagOutput`](crate::output::TagOutput) with field(s):
/// - [`arn(Option<String>)`](crate::output::TagOutput::arn): <p>The ARN of the tagged resource.</p>
/// - [`tags(Option<HashMap<String, String>>)`](crate::output::TagOutput::tags): <p>The tags that have been added to the specified resource group.</p>
/// - On failure, responds with [`SdkError<TagError>`](crate::error::TagError)
pub fn tag(&self) -> fluent_builders::Tag<C, M, R> {
fluent_builders::Tag::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`UngroupResources`](crate::client::fluent_builders::UngroupResources) operation.
///
/// - The fluent builder is configurable:
/// - [`group(impl Into<String>)`](crate::client::fluent_builders::UngroupResources::group) / [`set_group(Option<String>)`](crate::client::fluent_builders::UngroupResources::set_group): <p>The name or the ARN of the resource group from which to remove the resources.</p>
/// - [`resource_arns(Vec<String>)`](crate::client::fluent_builders::UngroupResources::resource_arns) / [`set_resource_arns(Option<Vec<String>>)`](crate::client::fluent_builders::UngroupResources::set_resource_arns): <p>The ARNs of the resources to be removed from the group.</p>
/// - On success, responds with [`UngroupResourcesOutput`](crate::output::UngroupResourcesOutput) with field(s):
/// - [`succeeded(Option<Vec<String>>)`](crate::output::UngroupResourcesOutput::succeeded): <p>A list of resources that were successfully removed from the group by this operation.</p>
/// - [`failed(Option<Vec<FailedResource>>)`](crate::output::UngroupResourcesOutput::failed): <p>A list of any resources that failed to be removed from the group by this operation.</p>
/// - [`pending(Option<Vec<PendingResource>>)`](crate::output::UngroupResourcesOutput::pending): <p>A list of any resources that are still in the process of being removed from the group by this operation. These pending removals continue asynchronously. You can check the status of pending removals by using the <code> <code>ListGroupResources</code> </code> operation. After the resource is successfully removed, it no longer appears in the response.</p>
/// - On failure, responds with [`SdkError<UngroupResourcesError>`](crate::error::UngroupResourcesError)
pub fn ungroup_resources(&self) -> fluent_builders::UngroupResources<C, M, R> {
fluent_builders::UngroupResources::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`Untag`](crate::client::fluent_builders::Untag) operation.
///
/// - The fluent builder is configurable:
/// - [`arn(impl Into<String>)`](crate::client::fluent_builders::Untag::arn) / [`set_arn(Option<String>)`](crate::client::fluent_builders::Untag::set_arn): <p>The ARN of the resource group from which to remove tags. The command removed both the specified keys and any values associated with those keys.</p>
/// - [`keys(Vec<String>)`](crate::client::fluent_builders::Untag::keys) / [`set_keys(Option<Vec<String>>)`](crate::client::fluent_builders::Untag::set_keys): <p>The keys of the tags to be removed.</p>
/// - On success, responds with [`UntagOutput`](crate::output::UntagOutput) with field(s):
/// - [`arn(Option<String>)`](crate::output::UntagOutput::arn): <p>The ARN of the resource group from which tags have been removed.</p>
/// - [`keys(Option<Vec<String>>)`](crate::output::UntagOutput::keys): <p>The keys of the tags that were removed.</p>
/// - On failure, responds with [`SdkError<UntagError>`](crate::error::UntagError)
pub fn untag(&self) -> fluent_builders::Untag<C, M, R> {
fluent_builders::Untag::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`UpdateGroup`](crate::client::fluent_builders::UpdateGroup) operation.
///
/// - The fluent builder is configurable:
/// - [`group_name(impl Into<String>)`](crate::client::fluent_builders::UpdateGroup::group_name) / [`set_group_name(Option<String>)`](crate::client::fluent_builders::UpdateGroup::set_group_name): <p>Don't use this parameter. Use <code>Group</code> instead.</p>
/// - [`group(impl Into<String>)`](crate::client::fluent_builders::UpdateGroup::group) / [`set_group(Option<String>)`](crate::client::fluent_builders::UpdateGroup::set_group): <p>The name or the ARN of the resource group to modify.</p>
/// - [`description(impl Into<String>)`](crate::client::fluent_builders::UpdateGroup::description) / [`set_description(Option<String>)`](crate::client::fluent_builders::UpdateGroup::set_description): <p>The new description that you want to update the resource group with. Descriptions can contain letters, numbers, hyphens, underscores, periods, and spaces.</p>
/// - On success, responds with [`UpdateGroupOutput`](crate::output::UpdateGroupOutput) with field(s):
/// - [`group(Option<Group>)`](crate::output::UpdateGroupOutput::group): <p>The update description of the resource group.</p>
/// - On failure, responds with [`SdkError<UpdateGroupError>`](crate::error::UpdateGroupError)
pub fn update_group(&self) -> fluent_builders::UpdateGroup<C, M, R> {
fluent_builders::UpdateGroup::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`UpdateGroupQuery`](crate::client::fluent_builders::UpdateGroupQuery) operation.
///
/// - The fluent builder is configurable:
/// - [`group_name(impl Into<String>)`](crate::client::fluent_builders::UpdateGroupQuery::group_name) / [`set_group_name(Option<String>)`](crate::client::fluent_builders::UpdateGroupQuery::set_group_name): <p>Don't use this parameter. Use <code>Group</code> instead.</p>
/// - [`group(impl Into<String>)`](crate::client::fluent_builders::UpdateGroupQuery::group) / [`set_group(Option<String>)`](crate::client::fluent_builders::UpdateGroupQuery::set_group): <p>The name or the ARN of the resource group to query.</p>
/// - [`resource_query(ResourceQuery)`](crate::client::fluent_builders::UpdateGroupQuery::resource_query) / [`set_resource_query(Option<ResourceQuery>)`](crate::client::fluent_builders::UpdateGroupQuery::set_resource_query): <p>The resource query to determine which AWS resources are members of this resource group.</p> <note> <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p> </note>
/// - On success, responds with [`UpdateGroupQueryOutput`](crate::output::UpdateGroupQueryOutput) with field(s):
/// - [`group_query(Option<GroupQuery>)`](crate::output::UpdateGroupQueryOutput::group_query): <p>The updated resource query associated with the resource group after the update.</p>
/// - On failure, responds with [`SdkError<UpdateGroupQueryError>`](crate::error::UpdateGroupQueryError)
pub fn update_group_query(&self) -> fluent_builders::UpdateGroupQuery<C, M, R> {
fluent_builders::UpdateGroupQuery::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 `CreateGroup`.
///
/// <p>Creates a resource group with the specified name and description. You can optionally include a resource query, or a service configuration. For more information about constructing a resource query, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>. For more information about service configurations, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for resource groups</a>.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:CreateGroup</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct CreateGroup<
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::create_group_input::Builder,
}
impl<C, M, R> CreateGroup<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 `CreateGroup`.
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::CreateGroupOutput,
aws_smithy_http::result::SdkError<crate::error::CreateGroupError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::CreateGroupInputOperationOutputAlias,
crate::output::CreateGroupOutput,
crate::error::CreateGroupError,
crate::input::CreateGroupInputOperationRetryAlias,
>,
{
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
}
/// <p>The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with <code>AWS</code> or <code>aws</code>; these are reserved. A resource group name must be unique within each AWS Region in your AWS account.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.name(input.into());
self
}
/// <p>The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with <code>AWS</code> or <code>aws</code>; these are reserved. A resource group name must be unique within each AWS Region in your AWS account.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_name(input);
self
}
/// <p>The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.description(input.into());
self
}
/// <p>The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_description(input);
self
}
/// <p>The resource query that determines which AWS resources are members of this group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>. </p> <note>
/// <p>A resource group can contain either a <code>ResourceQuery</code> or a <code>Configuration</code>, but not both.</p>
/// </note>
pub fn resource_query(mut self, input: crate::model::ResourceQuery) -> Self {
self.inner = self.inner.resource_query(input);
self
}
/// <p>The resource query that determines which AWS resources are members of this group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>. </p> <note>
/// <p>A resource group can contain either a <code>ResourceQuery</code> or a <code>Configuration</code>, but not both.</p>
/// </note>
pub fn set_resource_query(
mut self,
input: std::option::Option<crate::model::ResourceQuery>,
) -> Self {
self.inner = self.inner.set_resource_query(input);
self
}
/// Adds a key-value pair to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags to add to the group. A tag is key-value pair string.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k.into(), v.into());
self
}
/// <p>The tags to add to the group. A tag is key-value pair string.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// Appends an item to `Configuration`.
///
/// To override the contents of this collection use [`set_configuration`](Self::set_configuration).
///
/// <p>A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements. For details about the syntax of service configurations, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for resource groups</a>.</p> <note>
/// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
/// </note>
pub fn configuration(mut self, input: crate::model::GroupConfigurationItem) -> Self {
self.inner = self.inner.configuration(input);
self
}
/// <p>A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements. For details about the syntax of service configurations, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for resource groups</a>.</p> <note>
/// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
/// </note>
pub fn set_configuration(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::GroupConfigurationItem>>,
) -> Self {
self.inner = self.inner.set_configuration(input);
self
}
}
/// Fluent builder constructing a request to `DeleteGroup`.
///
/// <p>Deletes the specified resource group. Deleting a resource group does not delete any resources that are members of the group; it only deletes the group structure.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:DeleteGroup</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteGroup<
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::delete_group_input::Builder,
}
impl<C, M, R> DeleteGroup<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 `DeleteGroup`.
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::DeleteGroupOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteGroupError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DeleteGroupInputOperationOutputAlias,
crate::output::DeleteGroupOutput,
crate::error::DeleteGroupError,
crate::input::DeleteGroupInputOperationRetryAlias,
>,
{
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
}
/// <p>Deprecated - don't use this parameter. Use <code>Group</code> instead.</p>
pub fn group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group_name(input.into());
self
}
/// <p>Deprecated - don't use this parameter. Use <code>Group</code> instead.</p>
pub fn set_group_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group_name(input);
self
}
/// <p>The name or the ARN of the resource group to delete.</p>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group(input.into());
self
}
/// <p>The name or the ARN of the resource group to delete.</p>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group(input);
self
}
}
/// Fluent builder constructing a request to `GetGroup`.
///
/// <p>Returns information about a specified resource group.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:GetGroup</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetGroup<
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::get_group_input::Builder,
}
impl<C, M, R> GetGroup<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 `GetGroup`.
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::GetGroupOutput,
aws_smithy_http::result::SdkError<crate::error::GetGroupError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetGroupInputOperationOutputAlias,
crate::output::GetGroupOutput,
crate::error::GetGroupError,
crate::input::GetGroupInputOperationRetryAlias,
>,
{
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
}
/// <p>Deprecated - don't use this parameter. Use <code>Group</code> instead.</p>
pub fn group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group_name(input.into());
self
}
/// <p>Deprecated - don't use this parameter. Use <code>Group</code> instead.</p>
pub fn set_group_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group_name(input);
self
}
/// <p>The name or the ARN of the resource group to retrieve.</p>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group(input.into());
self
}
/// <p>The name or the ARN of the resource group to retrieve.</p>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group(input);
self
}
}
/// Fluent builder constructing a request to `GetGroupConfiguration`.
///
/// <p>Returns the service configuration associated with the specified resource group. For details about the service configuration syntax, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for resource groups</a>.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:GetGroupConfiguration</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetGroupConfiguration<
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::get_group_configuration_input::Builder,
}
impl<C, M, R> GetGroupConfiguration<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 `GetGroupConfiguration`.
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::GetGroupConfigurationOutput,
aws_smithy_http::result::SdkError<crate::error::GetGroupConfigurationError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetGroupConfigurationInputOperationOutputAlias,
crate::output::GetGroupConfigurationOutput,
crate::error::GetGroupConfigurationError,
crate::input::GetGroupConfigurationInputOperationRetryAlias,
>,
{
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
}
/// <p>The name or the ARN of the resource group.</p>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group(input.into());
self
}
/// <p>The name or the ARN of the resource group.</p>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group(input);
self
}
}
/// Fluent builder constructing a request to `GetGroupQuery`.
///
/// <p>Retrieves the resource query associated with the specified resource group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:GetGroupQuery</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetGroupQuery<
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::get_group_query_input::Builder,
}
impl<C, M, R> GetGroupQuery<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 `GetGroupQuery`.
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::GetGroupQueryOutput,
aws_smithy_http::result::SdkError<crate::error::GetGroupQueryError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetGroupQueryInputOperationOutputAlias,
crate::output::GetGroupQueryOutput,
crate::error::GetGroupQueryError,
crate::input::GetGroupQueryInputOperationRetryAlias,
>,
{
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
}
/// <p>Don't use this parameter. Use <code>Group</code> instead.</p>
pub fn group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group_name(input.into());
self
}
/// <p>Don't use this parameter. Use <code>Group</code> instead.</p>
pub fn set_group_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group_name(input);
self
}
/// <p>The name or the ARN of the resource group to query.</p>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group(input.into());
self
}
/// <p>The name or the ARN of the resource group to query.</p>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group(input);
self
}
}
/// Fluent builder constructing a request to `GetTags`.
///
/// <p>Returns a list of tags that are associated with a resource group, specified by an ARN.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:GetTags</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetTags<
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::get_tags_input::Builder,
}
impl<C, M, R> GetTags<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 `GetTags`.
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::GetTagsOutput,
aws_smithy_http::result::SdkError<crate::error::GetTagsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetTagsInputOperationOutputAlias,
crate::output::GetTagsOutput,
crate::error::GetTagsError,
crate::input::GetTagsInputOperationRetryAlias,
>,
{
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
}
/// <p>The ARN of the resource group whose tags you want to retrieve.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.arn(input.into());
self
}
/// <p>The ARN of the resource group whose tags you want to retrieve.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_arn(input);
self
}
}
/// Fluent builder constructing a request to `GroupResources`.
///
/// <p>Adds the specified resources to the specified group.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:GroupResources</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GroupResources<
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::group_resources_input::Builder,
}
impl<C, M, R> GroupResources<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 `GroupResources`.
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::GroupResourcesOutput,
aws_smithy_http::result::SdkError<crate::error::GroupResourcesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GroupResourcesInputOperationOutputAlias,
crate::output::GroupResourcesOutput,
crate::error::GroupResourcesError,
crate::input::GroupResourcesInputOperationRetryAlias,
>,
{
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
}
/// <p>The name or the ARN of the resource group to add resources to.</p>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group(input.into());
self
}
/// <p>The name or the ARN of the resource group to add resources to.</p>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group(input);
self
}
/// Appends an item to `ResourceArns`.
///
/// To override the contents of this collection use [`set_resource_arns`](Self::set_resource_arns).
///
/// <p>The list of ARNs for resources to be added to the group. </p>
pub fn resource_arns(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.resource_arns(input.into());
self
}
/// <p>The list of ARNs for resources to be added to the group. </p>
pub fn set_resource_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_resource_arns(input);
self
}
}
/// Fluent builder constructing a request to `ListGroupResources`.
///
/// <p>Returns a list of ARNs of the resources that are members of a specified resource group.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:ListGroupResources</code> </p> </li>
/// <li> <p> <code>cloudformation:DescribeStacks</code> </p> </li>
/// <li> <p> <code>cloudformation:ListStackResources</code> </p> </li>
/// <li> <p> <code>tag:GetResources</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListGroupResources<
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::list_group_resources_input::Builder,
}
impl<C, M, R> ListGroupResources<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 `ListGroupResources`.
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::ListGroupResourcesOutput,
aws_smithy_http::result::SdkError<crate::error::ListGroupResourcesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListGroupResourcesInputOperationOutputAlias,
crate::output::ListGroupResourcesOutput,
crate::error::ListGroupResourcesError,
crate::input::ListGroupResourcesInputOperationRetryAlias,
>,
{
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::ListGroupResourcesPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListGroupResourcesPaginator<C, M, R> {
crate::paginator::ListGroupResourcesPaginator::new(self.handle, self.inner)
}
/// <important>
/// <p> <i> <b>Deprecated - don't use this parameter. Use the <code>Group</code> request field instead.</b> </i> </p>
/// </important>
pub fn group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group_name(input.into());
self
}
/// <important>
/// <p> <i> <b>Deprecated - don't use this parameter. Use the <code>Group</code> request field instead.</b> </i> </p>
/// </important>
pub fn set_group_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group_name(input);
self
}
/// <p>The name or the ARN of the resource group</p>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group(input.into());
self
}
/// <p>The name or the ARN of the resource group</p>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group(input);
self
}
/// Appends an item to `Filters`.
///
/// To override the contents of this collection use [`set_filters`](Self::set_filters).
///
/// <p>Filters, formatted as <code>ResourceFilter</code> objects, that you want to apply to a <code>ListGroupResources</code> operation. Filters the results to include only those of the specified resource types.</p>
/// <ul>
/// <li> <p> <code>resource-type</code> - Filter resources by their type. Specify up to five resource types in the format <code>AWS::ServiceCode::ResourceType</code>. For example, <code>AWS::EC2::Instance</code>, or <code>AWS::S3::Bucket</code>. </p> </li>
/// </ul>
/// <p>When you specify a <code>resource-type</code> filter for <code>ListGroupResources</code>, AWS Resource Groups validates your filter resource types against the types that are defined in the query associated with the group. For example, if a group contains only S3 buckets because its query specifies only that resource type, but your <code>resource-type</code> filter includes EC2 instances, AWS Resource Groups does not filter for EC2 instances. In this case, a <code>ListGroupResources</code> request returns a <code>BadRequestException</code> error with a message similar to the following:</p>
/// <p> <code>The resource types specified as filters in the request are not valid.</code> </p>
/// <p>The error includes a list of resource types that failed the validation because they are not part of the query associated with the group. This validation doesn't occur when the group query specifies <code>AWS::AllSupported</code>, because a group based on such a query can contain any of the allowed resource types for the query type (tag-based or AWS CloudFormation stack-based queries).</p>
pub fn filters(mut self, input: crate::model::ResourceFilter) -> Self {
self.inner = self.inner.filters(input);
self
}
/// <p>Filters, formatted as <code>ResourceFilter</code> objects, that you want to apply to a <code>ListGroupResources</code> operation. Filters the results to include only those of the specified resource types.</p>
/// <ul>
/// <li> <p> <code>resource-type</code> - Filter resources by their type. Specify up to five resource types in the format <code>AWS::ServiceCode::ResourceType</code>. For example, <code>AWS::EC2::Instance</code>, or <code>AWS::S3::Bucket</code>. </p> </li>
/// </ul>
/// <p>When you specify a <code>resource-type</code> filter for <code>ListGroupResources</code>, AWS Resource Groups validates your filter resource types against the types that are defined in the query associated with the group. For example, if a group contains only S3 buckets because its query specifies only that resource type, but your <code>resource-type</code> filter includes EC2 instances, AWS Resource Groups does not filter for EC2 instances. In this case, a <code>ListGroupResources</code> request returns a <code>BadRequestException</code> error with a message similar to the following:</p>
/// <p> <code>The resource types specified as filters in the request are not valid.</code> </p>
/// <p>The error includes a list of resource types that failed the validation because they are not part of the query associated with the group. This validation doesn't occur when the group query specifies <code>AWS::AllSupported</code>, because a group based on such a query can contain any of the allowed resource types for the query type (tag-based or AWS CloudFormation stack-based queries).</p>
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ResourceFilter>>,
) -> Self {
self.inner = self.inner.set_filters(input);
self
}
/// <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</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 parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</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 `ListGroups`.
///
/// <p>Returns a list of existing resource groups in your account.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:ListGroups</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListGroups<
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::list_groups_input::Builder,
}
impl<C, M, R> ListGroups<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 `ListGroups`.
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::ListGroupsOutput,
aws_smithy_http::result::SdkError<crate::error::ListGroupsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListGroupsInputOperationOutputAlias,
crate::output::ListGroupsOutput,
crate::error::ListGroupsError,
crate::input::ListGroupsInputOperationRetryAlias,
>,
{
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::ListGroupsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListGroupsPaginator<C, M, R> {
crate::paginator::ListGroupsPaginator::new(self.handle, self.inner)
}
/// Appends an item to `Filters`.
///
/// To override the contents of this collection use [`set_filters`](Self::set_filters).
///
/// <p>Filters, formatted as <code>GroupFilter</code> objects, that you want to apply to a <code>ListGroups</code> operation.</p>
/// <ul>
/// <li> <p> <code>resource-type</code> - Filter the results to include only those of the specified resource types. Specify up to five resource types in the format <code>AWS::<i>ServiceCode</i>::<i>ResourceType</i> </code>. For example, <code>AWS::EC2::Instance</code>, or <code>AWS::S3::Bucket</code>.</p> </li>
/// <li> <p> <code>configuration-type</code> - Filter the results to include only those groups that have the specified configuration types attached. The current supported values are:</p>
/// <ul>
/// <li> <p> <code>AWS:EC2::CapacityReservationPool</code> </p> </li>
/// <li> <p> <code>AWS:EC2::HostManagement</code> </p> </li>
/// </ul> </li>
/// </ul>
pub fn filters(mut self, input: crate::model::GroupFilter) -> Self {
self.inner = self.inner.filters(input);
self
}
/// <p>Filters, formatted as <code>GroupFilter</code> objects, that you want to apply to a <code>ListGroups</code> operation.</p>
/// <ul>
/// <li> <p> <code>resource-type</code> - Filter the results to include only those of the specified resource types. Specify up to five resource types in the format <code>AWS::<i>ServiceCode</i>::<i>ResourceType</i> </code>. For example, <code>AWS::EC2::Instance</code>, or <code>AWS::S3::Bucket</code>.</p> </li>
/// <li> <p> <code>configuration-type</code> - Filter the results to include only those groups that have the specified configuration types attached. The current supported values are:</p>
/// <ul>
/// <li> <p> <code>AWS:EC2::CapacityReservationPool</code> </p> </li>
/// <li> <p> <code>AWS:EC2::HostManagement</code> </p> </li>
/// </ul> </li>
/// </ul>
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::GroupFilter>>,
) -> Self {
self.inner = self.inner.set_filters(input);
self
}
/// <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</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 parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</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 `PutGroupConfiguration`.
///
/// <p>Attaches a service configuration to the specified group. This occurs asynchronously, and can take time to complete. You can use <code>GetGroupConfiguration</code> to check the status of the update.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:PutGroupConfiguration</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct PutGroupConfiguration<
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::put_group_configuration_input::Builder,
}
impl<C, M, R> PutGroupConfiguration<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 `PutGroupConfiguration`.
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::PutGroupConfigurationOutput,
aws_smithy_http::result::SdkError<crate::error::PutGroupConfigurationError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::PutGroupConfigurationInputOperationOutputAlias,
crate::output::PutGroupConfigurationOutput,
crate::error::PutGroupConfigurationError,
crate::input::PutGroupConfigurationInputOperationRetryAlias,
>,
{
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
}
/// <p>The name or ARN of the resource group with the configuration that you want to update.</p>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group(input.into());
self
}
/// <p>The name or ARN of the resource group with the configuration that you want to update.</p>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group(input);
self
}
/// Appends an item to `Configuration`.
///
/// To override the contents of this collection use [`set_configuration`](Self::set_configuration).
///
/// <p>The new configuration to associate with the specified group. A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements.</p>
/// <p>For information about the syntax of a service configuration, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for resource groups</a>.</p> <note>
/// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
/// </note>
pub fn configuration(mut self, input: crate::model::GroupConfigurationItem) -> Self {
self.inner = self.inner.configuration(input);
self
}
/// <p>The new configuration to associate with the specified group. A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements.</p>
/// <p>For information about the syntax of a service configuration, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for resource groups</a>.</p> <note>
/// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
/// </note>
pub fn set_configuration(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::GroupConfigurationItem>>,
) -> Self {
self.inner = self.inner.set_configuration(input);
self
}
}
/// Fluent builder constructing a request to `SearchResources`.
///
/// <p>Returns a list of AWS resource identifiers that matches the specified query. The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery operation.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:SearchResources</code> </p> </li>
/// <li> <p> <code>cloudformation:DescribeStacks</code> </p> </li>
/// <li> <p> <code>cloudformation:ListStackResources</code> </p> </li>
/// <li> <p> <code>tag:GetResources</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct SearchResources<
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::search_resources_input::Builder,
}
impl<C, M, R> SearchResources<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 `SearchResources`.
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::SearchResourcesOutput,
aws_smithy_http::result::SdkError<crate::error::SearchResourcesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::SearchResourcesInputOperationOutputAlias,
crate::output::SearchResourcesOutput,
crate::error::SearchResourcesError,
crate::input::SearchResourcesInputOperationRetryAlias,
>,
{
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::SearchResourcesPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::SearchResourcesPaginator<C, M, R> {
crate::paginator::SearchResourcesPaginator::new(self.handle, self.inner)
}
/// <p>The search query, using the same formats that are supported for resource group definition. For more information, see <code>CreateGroup</code>.</p>
pub fn resource_query(mut self, input: crate::model::ResourceQuery) -> Self {
self.inner = self.inner.resource_query(input);
self
}
/// <p>The search query, using the same formats that are supported for resource group definition. For more information, see <code>CreateGroup</code>.</p>
pub fn set_resource_query(
mut self,
input: std::option::Option<crate::model::ResourceQuery>,
) -> Self {
self.inner = self.inner.set_resource_query(input);
self
}
/// <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</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 parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</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 `Tag`.
///
/// <p>Adds tags to a resource group with the specified ARN. Existing tags on a resource group are not changed if they are not specified in the request parameters.</p> <important>
/// <p>Do not store personally identifiable information (PII) or other confidential or sensitive information in tags. We use tags to provide you with billing and administration services. Tags are not intended to be used for private or sensitive data.</p>
/// </important>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:Tag</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct Tag<
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::tag_input::Builder,
}
impl<C, M, R> Tag<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 `Tag`.
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::TagOutput,
aws_smithy_http::result::SdkError<crate::error::TagError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::TagInputOperationOutputAlias,
crate::output::TagOutput,
crate::error::TagError,
crate::input::TagInputOperationRetryAlias,
>,
{
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
}
/// <p>The ARN of the resource group to which to add tags.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.arn(input.into());
self
}
/// <p>The ARN of the resource group to which to add tags.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_arn(input);
self
}
/// Adds a key-value pair to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags to add to the specified resource group. A tag is a string-to-string map of key-value pairs.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k.into(), v.into());
self
}
/// <p>The tags to add to the specified resource group. A tag is a string-to-string map of key-value pairs.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}
/// Fluent builder constructing a request to `UngroupResources`.
///
/// <p>Removes the specified resources from the specified group.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:UngroupResources</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct UngroupResources<
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::ungroup_resources_input::Builder,
}
impl<C, M, R> UngroupResources<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 `UngroupResources`.
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::UngroupResourcesOutput,
aws_smithy_http::result::SdkError<crate::error::UngroupResourcesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::UngroupResourcesInputOperationOutputAlias,
crate::output::UngroupResourcesOutput,
crate::error::UngroupResourcesError,
crate::input::UngroupResourcesInputOperationRetryAlias,
>,
{
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
}
/// <p>The name or the ARN of the resource group from which to remove the resources.</p>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group(input.into());
self
}
/// <p>The name or the ARN of the resource group from which to remove the resources.</p>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group(input);
self
}
/// Appends an item to `ResourceArns`.
///
/// To override the contents of this collection use [`set_resource_arns`](Self::set_resource_arns).
///
/// <p>The ARNs of the resources to be removed from the group.</p>
pub fn resource_arns(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.resource_arns(input.into());
self
}
/// <p>The ARNs of the resources to be removed from the group.</p>
pub fn set_resource_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_resource_arns(input);
self
}
}
/// Fluent builder constructing a request to `Untag`.
///
/// <p>Deletes tags from a specified resource group.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:Untag</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct Untag<
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::untag_input::Builder,
}
impl<C, M, R> Untag<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 `Untag`.
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::UntagOutput,
aws_smithy_http::result::SdkError<crate::error::UntagError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::UntagInputOperationOutputAlias,
crate::output::UntagOutput,
crate::error::UntagError,
crate::input::UntagInputOperationRetryAlias,
>,
{
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
}
/// <p>The ARN of the resource group from which to remove tags. The command removed both the specified keys and any values associated with those keys.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.arn(input.into());
self
}
/// <p>The ARN of the resource group from which to remove tags. The command removed both the specified keys and any values associated with those keys.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_arn(input);
self
}
/// Appends an item to `Keys`.
///
/// To override the contents of this collection use [`set_keys`](Self::set_keys).
///
/// <p>The keys of the tags to be removed.</p>
pub fn keys(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.keys(input.into());
self
}
/// <p>The keys of the tags to be removed.</p>
pub fn set_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_keys(input);
self
}
}
/// Fluent builder constructing a request to `UpdateGroup`.
///
/// <p>Updates the description for an existing group. You cannot update the name of a resource group.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:UpdateGroup</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct UpdateGroup<
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::update_group_input::Builder,
}
impl<C, M, R> UpdateGroup<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 `UpdateGroup`.
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::UpdateGroupOutput,
aws_smithy_http::result::SdkError<crate::error::UpdateGroupError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::UpdateGroupInputOperationOutputAlias,
crate::output::UpdateGroupOutput,
crate::error::UpdateGroupError,
crate::input::UpdateGroupInputOperationRetryAlias,
>,
{
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
}
/// <p>Don't use this parameter. Use <code>Group</code> instead.</p>
pub fn group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group_name(input.into());
self
}
/// <p>Don't use this parameter. Use <code>Group</code> instead.</p>
pub fn set_group_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group_name(input);
self
}
/// <p>The name or the ARN of the resource group to modify.</p>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group(input.into());
self
}
/// <p>The name or the ARN of the resource group to modify.</p>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group(input);
self
}
/// <p>The new description that you want to update the resource group with. Descriptions can contain letters, numbers, hyphens, underscores, periods, and spaces.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.description(input.into());
self
}
/// <p>The new description that you want to update the resource group with. Descriptions can contain letters, numbers, hyphens, underscores, periods, and spaces.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_description(input);
self
}
}
/// Fluent builder constructing a request to `UpdateGroupQuery`.
///
/// <p>Updates the resource query of a group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>.</p>
/// <p> <b>Minimum permissions</b> </p>
/// <p>To run this command, you must have the following permissions:</p>
/// <ul>
/// <li> <p> <code>resource-groups:UpdateGroupQuery</code> </p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct UpdateGroupQuery<
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::update_group_query_input::Builder,
}
impl<C, M, R> UpdateGroupQuery<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 `UpdateGroupQuery`.
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::UpdateGroupQueryOutput,
aws_smithy_http::result::SdkError<crate::error::UpdateGroupQueryError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::UpdateGroupQueryInputOperationOutputAlias,
crate::output::UpdateGroupQueryOutput,
crate::error::UpdateGroupQueryError,
crate::input::UpdateGroupQueryInputOperationRetryAlias,
>,
{
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
}
/// <p>Don't use this parameter. Use <code>Group</code> instead.</p>
pub fn group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group_name(input.into());
self
}
/// <p>Don't use this parameter. Use <code>Group</code> instead.</p>
pub fn set_group_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group_name(input);
self
}
/// <p>The name or the ARN of the resource group to query.</p>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group(input.into());
self
}
/// <p>The name or the ARN of the resource group to query.</p>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group(input);
self
}
/// <p>The resource query to determine which AWS resources are members of this resource group.</p> <note>
/// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
/// </note>
pub fn resource_query(mut self, input: crate::model::ResourceQuery) -> Self {
self.inner = self.inner.resource_query(input);
self
}
/// <p>The resource query to determine which AWS resources are members of this resource group.</p> <note>
/// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
/// </note>
pub fn set_resource_query(
mut self,
input: std::option::Option<crate::model::ResourceQuery>,
) -> Self {
self.inner = self.inner.set_resource_query(input);
self
}
}
}
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 }),
}
}
}