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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Displays errors that occurred during validation of the resource policy.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ValidationErrorsEntry {
/// <p>Checks the name of the policy.</p>
#[doc(hidden)]
pub check_name: std::option::Option<std::string::String>,
/// <p>Displays error messages if validation encounters problems during validation of the resource policy.</p>
#[doc(hidden)]
pub error_message: std::option::Option<std::string::String>,
}
impl ValidationErrorsEntry {
/// <p>Checks the name of the policy.</p>
pub fn check_name(&self) -> std::option::Option<&str> {
self.check_name.as_deref()
}
/// <p>Displays error messages if validation encounters problems during validation of the resource policy.</p>
pub fn error_message(&self) -> std::option::Option<&str> {
self.error_message.as_deref()
}
}
impl std::fmt::Debug for ValidationErrorsEntry {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ValidationErrorsEntry");
formatter.field("check_name", &self.check_name);
formatter.field("error_message", &self.error_message);
formatter.finish()
}
}
/// See [`ValidationErrorsEntry`](crate::model::ValidationErrorsEntry).
pub mod validation_errors_entry {
/// A builder for [`ValidationErrorsEntry`](crate::model::ValidationErrorsEntry).
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) check_name: std::option::Option<std::string::String>,
pub(crate) error_message: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>Checks the name of the policy.</p>
pub fn check_name(mut self, input: impl Into<std::string::String>) -> Self {
self.check_name = Some(input.into());
self
}
/// <p>Checks the name of the policy.</p>
pub fn set_check_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.check_name = input;
self
}
/// <p>Displays error messages if validation encounters problems during validation of the resource policy.</p>
pub fn error_message(mut self, input: impl Into<std::string::String>) -> Self {
self.error_message = Some(input.into());
self
}
/// <p>Displays error messages if validation encounters problems during validation of the resource policy.</p>
pub fn set_error_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.error_message = input;
self
}
/// Consumes the builder and constructs a [`ValidationErrorsEntry`](crate::model::ValidationErrorsEntry).
pub fn build(self) -> crate::model::ValidationErrorsEntry {
crate::model::ValidationErrorsEntry {
check_name: self.check_name,
error_message: self.error_message,
}
}
}
}
impl ValidationErrorsEntry {
/// Creates a new builder-style object to manufacture [`ValidationErrorsEntry`](crate::model::ValidationErrorsEntry).
pub fn builder() -> crate::model::validation_errors_entry::Builder {
crate::model::validation_errors_entry::Builder::default()
}
}
/// <p>A structure that contains information about a tag.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Tag {
/// <p>The key identifier, or name, of the tag.</p>
#[doc(hidden)]
pub key: std::option::Option<std::string::String>,
/// <p>The string value associated with the key of the tag.</p>
#[doc(hidden)]
pub value: std::option::Option<std::string::String>,
}
impl Tag {
/// <p>The key identifier, or name, of the tag.</p>
pub fn key(&self) -> std::option::Option<&str> {
self.key.as_deref()
}
/// <p>The string value associated with the key of the tag.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
impl std::fmt::Debug for Tag {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Tag");
formatter.field("key", &self.key);
formatter.field("value", &self.value);
formatter.finish()
}
}
/// See [`Tag`](crate::model::Tag).
pub mod tag {
/// A builder for [`Tag`](crate::model::Tag).
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) key: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The key identifier, or name, of the tag.</p>
pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
self.key = Some(input.into());
self
}
/// <p>The key identifier, or name, of the tag.</p>
pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
self.key = input;
self
}
/// <p>The string value associated with the key of the tag.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The string value associated with the key of the tag.</p>
pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
self.value = input;
self
}
/// Consumes the builder and constructs a [`Tag`](crate::model::Tag).
pub fn build(self) -> crate::model::Tag {
crate::model::Tag {
key: self.key,
value: self.value,
}
}
}
}
impl Tag {
/// Creates a new builder-style object to manufacture [`Tag`](crate::model::Tag).
pub fn builder() -> crate::model::tag::Builder {
crate::model::tag::Builder::default()
}
}
/// <p>A structure that defines the rotation configuration for the secret.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct RotationRulesType {
/// <p>The number of days between automatic scheduled rotations of the secret. You can use this value to check that your secret meets your compliance guidelines for how often secrets must be rotated.</p>
/// <p>In <code>DescribeSecret</code> and <code>ListSecrets</code>, this value is calculated from the rotation schedule after every successful rotation. In <code>RotateSecret</code>, you can set the rotation schedule in <code>RotationRules</code> with <code>AutomaticallyAfterDays</code> or <code>ScheduleExpression</code>, but not both.</p>
#[doc(hidden)]
pub automatically_after_days: std::option::Option<i64>,
/// <p>The length of the rotation window in hours, for example <code>3h</code> for a three hour window. Secrets Manager rotates your secret at any time during this window. The window must not go into the next UTC day. If you don't specify this value, the window automatically ends at the end of the UTC day. The window begins according to the <code>ScheduleExpression</code>. For more information, including examples, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html">Schedule expressions in Secrets Manager rotation</a>.</p>
#[doc(hidden)]
pub duration: std::option::Option<std::string::String>,
/// <p>A <code>cron()</code> or <code>rate()</code> expression that defines the schedule for rotating your secret. Secrets Manager rotation schedules use UTC time zone. </p>
/// <p>Secrets Manager <code>rate()</code> expressions represent the interval in days that you want to rotate your secret, for example <code>rate(10 days)</code>. If you use a <code>rate()</code> expression, the rotation window opens at midnight, and Secrets Manager rotates your secret any time that day after midnight. You can set a <code>Duration</code> to shorten the rotation window.</p>
/// <p>You can use a <code>cron()</code> expression to create rotation schedules that are more detailed than a rotation interval. For more information, including examples, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html">Schedule expressions in Secrets Manager rotation</a>. If you use a <code>cron()</code> expression, Secrets Manager rotates your secret any time during that day after the window opens. For example, <code>cron(0 8 1 * ? *)</code> represents a rotation window that occurs on the first day of every month beginning at 8:00 AM UTC. Secrets Manager rotates the secret any time that day after 8:00 AM. You can set a <code>Duration</code> to shorten the rotation window.</p>
#[doc(hidden)]
pub schedule_expression: std::option::Option<std::string::String>,
}
impl RotationRulesType {
/// <p>The number of days between automatic scheduled rotations of the secret. You can use this value to check that your secret meets your compliance guidelines for how often secrets must be rotated.</p>
/// <p>In <code>DescribeSecret</code> and <code>ListSecrets</code>, this value is calculated from the rotation schedule after every successful rotation. In <code>RotateSecret</code>, you can set the rotation schedule in <code>RotationRules</code> with <code>AutomaticallyAfterDays</code> or <code>ScheduleExpression</code>, but not both.</p>
pub fn automatically_after_days(&self) -> std::option::Option<i64> {
self.automatically_after_days
}
/// <p>The length of the rotation window in hours, for example <code>3h</code> for a three hour window. Secrets Manager rotates your secret at any time during this window. The window must not go into the next UTC day. If you don't specify this value, the window automatically ends at the end of the UTC day. The window begins according to the <code>ScheduleExpression</code>. For more information, including examples, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html">Schedule expressions in Secrets Manager rotation</a>.</p>
pub fn duration(&self) -> std::option::Option<&str> {
self.duration.as_deref()
}
/// <p>A <code>cron()</code> or <code>rate()</code> expression that defines the schedule for rotating your secret. Secrets Manager rotation schedules use UTC time zone. </p>
/// <p>Secrets Manager <code>rate()</code> expressions represent the interval in days that you want to rotate your secret, for example <code>rate(10 days)</code>. If you use a <code>rate()</code> expression, the rotation window opens at midnight, and Secrets Manager rotates your secret any time that day after midnight. You can set a <code>Duration</code> to shorten the rotation window.</p>
/// <p>You can use a <code>cron()</code> expression to create rotation schedules that are more detailed than a rotation interval. For more information, including examples, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html">Schedule expressions in Secrets Manager rotation</a>. If you use a <code>cron()</code> expression, Secrets Manager rotates your secret any time during that day after the window opens. For example, <code>cron(0 8 1 * ? *)</code> represents a rotation window that occurs on the first day of every month beginning at 8:00 AM UTC. Secrets Manager rotates the secret any time that day after 8:00 AM. You can set a <code>Duration</code> to shorten the rotation window.</p>
pub fn schedule_expression(&self) -> std::option::Option<&str> {
self.schedule_expression.as_deref()
}
}
impl std::fmt::Debug for RotationRulesType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("RotationRulesType");
formatter.field("automatically_after_days", &self.automatically_after_days);
formatter.field("duration", &self.duration);
formatter.field("schedule_expression", &self.schedule_expression);
formatter.finish()
}
}
/// See [`RotationRulesType`](crate::model::RotationRulesType).
pub mod rotation_rules_type {
/// A builder for [`RotationRulesType`](crate::model::RotationRulesType).
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) automatically_after_days: std::option::Option<i64>,
pub(crate) duration: std::option::Option<std::string::String>,
pub(crate) schedule_expression: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The number of days between automatic scheduled rotations of the secret. You can use this value to check that your secret meets your compliance guidelines for how often secrets must be rotated.</p>
/// <p>In <code>DescribeSecret</code> and <code>ListSecrets</code>, this value is calculated from the rotation schedule after every successful rotation. In <code>RotateSecret</code>, you can set the rotation schedule in <code>RotationRules</code> with <code>AutomaticallyAfterDays</code> or <code>ScheduleExpression</code>, but not both.</p>
pub fn automatically_after_days(mut self, input: i64) -> Self {
self.automatically_after_days = Some(input);
self
}
/// <p>The number of days between automatic scheduled rotations of the secret. You can use this value to check that your secret meets your compliance guidelines for how often secrets must be rotated.</p>
/// <p>In <code>DescribeSecret</code> and <code>ListSecrets</code>, this value is calculated from the rotation schedule after every successful rotation. In <code>RotateSecret</code>, you can set the rotation schedule in <code>RotationRules</code> with <code>AutomaticallyAfterDays</code> or <code>ScheduleExpression</code>, but not both.</p>
pub fn set_automatically_after_days(mut self, input: std::option::Option<i64>) -> Self {
self.automatically_after_days = input;
self
}
/// <p>The length of the rotation window in hours, for example <code>3h</code> for a three hour window. Secrets Manager rotates your secret at any time during this window. The window must not go into the next UTC day. If you don't specify this value, the window automatically ends at the end of the UTC day. The window begins according to the <code>ScheduleExpression</code>. For more information, including examples, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html">Schedule expressions in Secrets Manager rotation</a>.</p>
pub fn duration(mut self, input: impl Into<std::string::String>) -> Self {
self.duration = Some(input.into());
self
}
/// <p>The length of the rotation window in hours, for example <code>3h</code> for a three hour window. Secrets Manager rotates your secret at any time during this window. The window must not go into the next UTC day. If you don't specify this value, the window automatically ends at the end of the UTC day. The window begins according to the <code>ScheduleExpression</code>. For more information, including examples, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html">Schedule expressions in Secrets Manager rotation</a>.</p>
pub fn set_duration(mut self, input: std::option::Option<std::string::String>) -> Self {
self.duration = input;
self
}
/// <p>A <code>cron()</code> or <code>rate()</code> expression that defines the schedule for rotating your secret. Secrets Manager rotation schedules use UTC time zone. </p>
/// <p>Secrets Manager <code>rate()</code> expressions represent the interval in days that you want to rotate your secret, for example <code>rate(10 days)</code>. If you use a <code>rate()</code> expression, the rotation window opens at midnight, and Secrets Manager rotates your secret any time that day after midnight. You can set a <code>Duration</code> to shorten the rotation window.</p>
/// <p>You can use a <code>cron()</code> expression to create rotation schedules that are more detailed than a rotation interval. For more information, including examples, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html">Schedule expressions in Secrets Manager rotation</a>. If you use a <code>cron()</code> expression, Secrets Manager rotates your secret any time during that day after the window opens. For example, <code>cron(0 8 1 * ? *)</code> represents a rotation window that occurs on the first day of every month beginning at 8:00 AM UTC. Secrets Manager rotates the secret any time that day after 8:00 AM. You can set a <code>Duration</code> to shorten the rotation window.</p>
pub fn schedule_expression(mut self, input: impl Into<std::string::String>) -> Self {
self.schedule_expression = Some(input.into());
self
}
/// <p>A <code>cron()</code> or <code>rate()</code> expression that defines the schedule for rotating your secret. Secrets Manager rotation schedules use UTC time zone. </p>
/// <p>Secrets Manager <code>rate()</code> expressions represent the interval in days that you want to rotate your secret, for example <code>rate(10 days)</code>. If you use a <code>rate()</code> expression, the rotation window opens at midnight, and Secrets Manager rotates your secret any time that day after midnight. You can set a <code>Duration</code> to shorten the rotation window.</p>
/// <p>You can use a <code>cron()</code> expression to create rotation schedules that are more detailed than a rotation interval. For more information, including examples, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html">Schedule expressions in Secrets Manager rotation</a>. If you use a <code>cron()</code> expression, Secrets Manager rotates your secret any time during that day after the window opens. For example, <code>cron(0 8 1 * ? *)</code> represents a rotation window that occurs on the first day of every month beginning at 8:00 AM UTC. Secrets Manager rotates the secret any time that day after 8:00 AM. You can set a <code>Duration</code> to shorten the rotation window.</p>
pub fn set_schedule_expression(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.schedule_expression = input;
self
}
/// Consumes the builder and constructs a [`RotationRulesType`](crate::model::RotationRulesType).
pub fn build(self) -> crate::model::RotationRulesType {
crate::model::RotationRulesType {
automatically_after_days: self.automatically_after_days,
duration: self.duration,
schedule_expression: self.schedule_expression,
}
}
}
}
impl RotationRulesType {
/// Creates a new builder-style object to manufacture [`RotationRulesType`](crate::model::RotationRulesType).
pub fn builder() -> crate::model::rotation_rules_type::Builder {
crate::model::rotation_rules_type::Builder::default()
}
}
/// <p>A replication object consisting of a <code>RegionReplicationStatus</code> object and includes a Region, KMSKeyId, status, and status message.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ReplicationStatusType {
/// <p>The Region where replication occurs.</p>
#[doc(hidden)]
pub region: std::option::Option<std::string::String>,
/// <p>Can be an <code>ARN</code>, <code>Key ID</code>, or <code>Alias</code>. </p>
#[doc(hidden)]
pub kms_key_id: std::option::Option<std::string::String>,
/// <p>The status can be <code>InProgress</code>, <code>Failed</code>, or <code>InSync</code>.</p>
#[doc(hidden)]
pub status: std::option::Option<crate::model::StatusType>,
/// <p>Status message such as "<i>Secret with this name already exists in this region</i>".</p>
#[doc(hidden)]
pub status_message: std::option::Option<std::string::String>,
/// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
#[doc(hidden)]
pub last_accessed_date: std::option::Option<aws_smithy_types::DateTime>,
}
impl ReplicationStatusType {
/// <p>The Region where replication occurs.</p>
pub fn region(&self) -> std::option::Option<&str> {
self.region.as_deref()
}
/// <p>Can be an <code>ARN</code>, <code>Key ID</code>, or <code>Alias</code>. </p>
pub fn kms_key_id(&self) -> std::option::Option<&str> {
self.kms_key_id.as_deref()
}
/// <p>The status can be <code>InProgress</code>, <code>Failed</code>, or <code>InSync</code>.</p>
pub fn status(&self) -> std::option::Option<&crate::model::StatusType> {
self.status.as_ref()
}
/// <p>Status message such as "<i>Secret with this name already exists in this region</i>".</p>
pub fn status_message(&self) -> std::option::Option<&str> {
self.status_message.as_deref()
}
/// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
pub fn last_accessed_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_accessed_date.as_ref()
}
}
impl std::fmt::Debug for ReplicationStatusType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ReplicationStatusType");
formatter.field("region", &self.region);
formatter.field("kms_key_id", &self.kms_key_id);
formatter.field("status", &self.status);
formatter.field("status_message", &self.status_message);
formatter.field("last_accessed_date", &self.last_accessed_date);
formatter.finish()
}
}
/// See [`ReplicationStatusType`](crate::model::ReplicationStatusType).
pub mod replication_status_type {
/// A builder for [`ReplicationStatusType`](crate::model::ReplicationStatusType).
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) region: std::option::Option<std::string::String>,
pub(crate) kms_key_id: std::option::Option<std::string::String>,
pub(crate) status: std::option::Option<crate::model::StatusType>,
pub(crate) status_message: std::option::Option<std::string::String>,
pub(crate) last_accessed_date: std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
/// <p>The Region where replication occurs.</p>
pub fn region(mut self, input: impl Into<std::string::String>) -> Self {
self.region = Some(input.into());
self
}
/// <p>The Region where replication occurs.</p>
pub fn set_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.region = input;
self
}
/// <p>Can be an <code>ARN</code>, <code>Key ID</code>, or <code>Alias</code>. </p>
pub fn kms_key_id(mut self, input: impl Into<std::string::String>) -> Self {
self.kms_key_id = Some(input.into());
self
}
/// <p>Can be an <code>ARN</code>, <code>Key ID</code>, or <code>Alias</code>. </p>
pub fn set_kms_key_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.kms_key_id = input;
self
}
/// <p>The status can be <code>InProgress</code>, <code>Failed</code>, or <code>InSync</code>.</p>
pub fn status(mut self, input: crate::model::StatusType) -> Self {
self.status = Some(input);
self
}
/// <p>The status can be <code>InProgress</code>, <code>Failed</code>, or <code>InSync</code>.</p>
pub fn set_status(mut self, input: std::option::Option<crate::model::StatusType>) -> Self {
self.status = input;
self
}
/// <p>Status message such as "<i>Secret with this name already exists in this region</i>".</p>
pub fn status_message(mut self, input: impl Into<std::string::String>) -> Self {
self.status_message = Some(input.into());
self
}
/// <p>Status message such as "<i>Secret with this name already exists in this region</i>".</p>
pub fn set_status_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.status_message = input;
self
}
/// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
pub fn last_accessed_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_accessed_date = Some(input);
self
}
/// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
pub fn set_last_accessed_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_accessed_date = input;
self
}
/// Consumes the builder and constructs a [`ReplicationStatusType`](crate::model::ReplicationStatusType).
pub fn build(self) -> crate::model::ReplicationStatusType {
crate::model::ReplicationStatusType {
region: self.region,
kms_key_id: self.kms_key_id,
status: self.status,
status_message: self.status_message,
last_accessed_date: self.last_accessed_date,
}
}
}
}
impl ReplicationStatusType {
/// Creates a new builder-style object to manufacture [`ReplicationStatusType`](crate::model::ReplicationStatusType).
pub fn builder() -> crate::model::replication_status_type::Builder {
crate::model::replication_status_type::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum StatusType {
#[allow(missing_docs)] // documentation missing in model
Failed,
#[allow(missing_docs)] // documentation missing in model
InProgress,
#[allow(missing_docs)] // documentation missing in model
InSync,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for StatusType {
fn from(s: &str) -> Self {
match s {
"Failed" => StatusType::Failed,
"InProgress" => StatusType::InProgress,
"InSync" => StatusType::InSync,
other => StatusType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for StatusType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(StatusType::from(s))
}
}
impl StatusType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
StatusType::Failed => "Failed",
StatusType::InProgress => "InProgress",
StatusType::InSync => "InSync",
StatusType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["Failed", "InProgress", "InSync"]
}
}
impl AsRef<str> for StatusType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>A custom type that specifies a <code>Region</code> and the <code>KmsKeyId</code> for a replica secret.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ReplicaRegionType {
/// <p>A Region code. For a list of Region codes, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints">Name and code of Regions</a>.</p>
#[doc(hidden)]
pub region: std::option::Option<std::string::String>,
/// <p>The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include this field, Secrets Manager uses <code>aws/secretsmanager</code>.</p>
#[doc(hidden)]
pub kms_key_id: std::option::Option<std::string::String>,
}
impl ReplicaRegionType {
/// <p>A Region code. For a list of Region codes, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints">Name and code of Regions</a>.</p>
pub fn region(&self) -> std::option::Option<&str> {
self.region.as_deref()
}
/// <p>The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include this field, Secrets Manager uses <code>aws/secretsmanager</code>.</p>
pub fn kms_key_id(&self) -> std::option::Option<&str> {
self.kms_key_id.as_deref()
}
}
impl std::fmt::Debug for ReplicaRegionType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ReplicaRegionType");
formatter.field("region", &self.region);
formatter.field("kms_key_id", &self.kms_key_id);
formatter.finish()
}
}
/// See [`ReplicaRegionType`](crate::model::ReplicaRegionType).
pub mod replica_region_type {
/// A builder for [`ReplicaRegionType`](crate::model::ReplicaRegionType).
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) region: std::option::Option<std::string::String>,
pub(crate) kms_key_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>A Region code. For a list of Region codes, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints">Name and code of Regions</a>.</p>
pub fn region(mut self, input: impl Into<std::string::String>) -> Self {
self.region = Some(input.into());
self
}
/// <p>A Region code. For a list of Region codes, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints">Name and code of Regions</a>.</p>
pub fn set_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.region = input;
self
}
/// <p>The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include this field, Secrets Manager uses <code>aws/secretsmanager</code>.</p>
pub fn kms_key_id(mut self, input: impl Into<std::string::String>) -> Self {
self.kms_key_id = Some(input.into());
self
}
/// <p>The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include this field, Secrets Manager uses <code>aws/secretsmanager</code>.</p>
pub fn set_kms_key_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.kms_key_id = input;
self
}
/// Consumes the builder and constructs a [`ReplicaRegionType`](crate::model::ReplicaRegionType).
pub fn build(self) -> crate::model::ReplicaRegionType {
crate::model::ReplicaRegionType {
region: self.region,
kms_key_id: self.kms_key_id,
}
}
}
}
impl ReplicaRegionType {
/// Creates a new builder-style object to manufacture [`ReplicaRegionType`](crate::model::ReplicaRegionType).
pub fn builder() -> crate::model::replica_region_type::Builder {
crate::model::replica_region_type::Builder::default()
}
}
/// <p>A structure that contains information about one version of a secret.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SecretVersionsListEntry {
/// <p>The unique version identifier of this version of the secret.</p>
#[doc(hidden)]
pub version_id: std::option::Option<std::string::String>,
/// <p>An array of staging labels that are currently associated with this version of the secret.</p>
#[doc(hidden)]
pub version_stages: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The date that this version of the secret was last accessed. Note that the resolution of this field is at the date level and does not include the time.</p>
#[doc(hidden)]
pub last_accessed_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The date and time this version of the secret was created.</p>
#[doc(hidden)]
pub created_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The KMS keys used to encrypt the secret version.</p>
#[doc(hidden)]
pub kms_key_ids: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl SecretVersionsListEntry {
/// <p>The unique version identifier of this version of the secret.</p>
pub fn version_id(&self) -> std::option::Option<&str> {
self.version_id.as_deref()
}
/// <p>An array of staging labels that are currently associated with this version of the secret.</p>
pub fn version_stages(&self) -> std::option::Option<&[std::string::String]> {
self.version_stages.as_deref()
}
/// <p>The date that this version of the secret was last accessed. Note that the resolution of this field is at the date level and does not include the time.</p>
pub fn last_accessed_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_accessed_date.as_ref()
}
/// <p>The date and time this version of the secret was created.</p>
pub fn created_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.created_date.as_ref()
}
/// <p>The KMS keys used to encrypt the secret version.</p>
pub fn kms_key_ids(&self) -> std::option::Option<&[std::string::String]> {
self.kms_key_ids.as_deref()
}
}
impl std::fmt::Debug for SecretVersionsListEntry {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SecretVersionsListEntry");
formatter.field("version_id", &self.version_id);
formatter.field("version_stages", &self.version_stages);
formatter.field("last_accessed_date", &self.last_accessed_date);
formatter.field("created_date", &self.created_date);
formatter.field("kms_key_ids", &self.kms_key_ids);
formatter.finish()
}
}
/// See [`SecretVersionsListEntry`](crate::model::SecretVersionsListEntry).
pub mod secret_versions_list_entry {
/// A builder for [`SecretVersionsListEntry`](crate::model::SecretVersionsListEntry).
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) version_id: std::option::Option<std::string::String>,
pub(crate) version_stages: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) last_accessed_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) created_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) kms_key_ids: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
/// <p>The unique version identifier of this version of the secret.</p>
pub fn version_id(mut self, input: impl Into<std::string::String>) -> Self {
self.version_id = Some(input.into());
self
}
/// <p>The unique version identifier of this version of the secret.</p>
pub fn set_version_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.version_id = input;
self
}
/// Appends an item to `version_stages`.
///
/// To override the contents of this collection use [`set_version_stages`](Self::set_version_stages).
///
/// <p>An array of staging labels that are currently associated with this version of the secret.</p>
pub fn version_stages(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.version_stages.unwrap_or_default();
v.push(input.into());
self.version_stages = Some(v);
self
}
/// <p>An array of staging labels that are currently associated with this version of the secret.</p>
pub fn set_version_stages(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.version_stages = input;
self
}
/// <p>The date that this version of the secret was last accessed. Note that the resolution of this field is at the date level and does not include the time.</p>
pub fn last_accessed_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_accessed_date = Some(input);
self
}
/// <p>The date that this version of the secret was last accessed. Note that the resolution of this field is at the date level and does not include the time.</p>
pub fn set_last_accessed_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_accessed_date = input;
self
}
/// <p>The date and time this version of the secret was created.</p>
pub fn created_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.created_date = Some(input);
self
}
/// <p>The date and time this version of the secret was created.</p>
pub fn set_created_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.created_date = input;
self
}
/// Appends an item to `kms_key_ids`.
///
/// To override the contents of this collection use [`set_kms_key_ids`](Self::set_kms_key_ids).
///
/// <p>The KMS keys used to encrypt the secret version.</p>
pub fn kms_key_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.kms_key_ids.unwrap_or_default();
v.push(input.into());
self.kms_key_ids = Some(v);
self
}
/// <p>The KMS keys used to encrypt the secret version.</p>
pub fn set_kms_key_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.kms_key_ids = input;
self
}
/// Consumes the builder and constructs a [`SecretVersionsListEntry`](crate::model::SecretVersionsListEntry).
pub fn build(self) -> crate::model::SecretVersionsListEntry {
crate::model::SecretVersionsListEntry {
version_id: self.version_id,
version_stages: self.version_stages,
last_accessed_date: self.last_accessed_date,
created_date: self.created_date,
kms_key_ids: self.kms_key_ids,
}
}
}
}
impl SecretVersionsListEntry {
/// Creates a new builder-style object to manufacture [`SecretVersionsListEntry`](crate::model::SecretVersionsListEntry).
pub fn builder() -> crate::model::secret_versions_list_entry::Builder {
crate::model::secret_versions_list_entry::Builder::default()
}
}
/// <p>A structure that contains the details about a secret. It does not include the encrypted <code>SecretString</code> and <code>SecretBinary</code> values. To get those values, use <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html">GetSecretValue</a> .</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SecretListEntry {
/// <p>The Amazon Resource Name (ARN) of the secret.</p>
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
/// <p>The friendly name of the secret. You can use forward slashes in the name to represent a path hierarchy. For example, <code>/prod/databases/dbserver1</code> could represent the secret for a server named <code>dbserver1</code> in the folder <code>databases</code> in the folder <code>prod</code>. </p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>The user-provided description of the secret.</p>
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
/// <p>The ARN of the KMS key that Secrets Manager uses to encrypt the secret value. If the secret is encrypted with the Amazon Web Services managed key <code>aws/secretsmanager</code>, this field is omitted.</p>
#[doc(hidden)]
pub kms_key_id: std::option::Option<std::string::String>,
/// <p>Indicates whether automatic, scheduled rotation is enabled for this secret.</p>
#[doc(hidden)]
pub rotation_enabled: std::option::Option<bool>,
/// <p>The ARN of an Amazon Web Services Lambda function invoked by Secrets Manager to rotate and expire the secret either automatically per the schedule or manually by a call to <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_RotateSecret.html"> <code>RotateSecret</code> </a>.</p>
#[doc(hidden)]
pub rotation_lambda_arn: std::option::Option<std::string::String>,
/// <p>A structure that defines the rotation configuration for the secret.</p>
#[doc(hidden)]
pub rotation_rules: std::option::Option<crate::model::RotationRulesType>,
/// <p>The most recent date and time that the Secrets Manager rotation process was successfully completed. This value is null if the secret hasn't ever rotated.</p>
#[doc(hidden)]
pub last_rotated_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The last date and time that this secret was modified in any way.</p>
#[doc(hidden)]
pub last_changed_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
#[doc(hidden)]
pub last_accessed_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The date and time the deletion of the secret occurred. Not present on active secrets. The secret can be recovered until the number of days in the recovery window has passed, as specified in the <code>RecoveryWindowInDays</code> parameter of the <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html"> <code>DeleteSecret</code> </a> operation.</p>
#[doc(hidden)]
pub deleted_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The list of user-defined tags associated with the secret. To add tags to a secret, use <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_TagResource.html"> <code>TagResource</code> </a>. To remove tags, use <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_UntagResource.html"> <code>UntagResource</code> </a>.</p>
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
/// <p>A list of all of the currently assigned <code>SecretVersionStage</code> staging labels and the <code>SecretVersionId</code> attached to each one. Staging labels are used to keep track of the different versions during the rotation process.</p> <note>
/// <p>A version that does not have any <code>SecretVersionStage</code> is considered deprecated and subject to deletion. Such versions are not included in this list.</p>
/// </note>
#[doc(hidden)]
pub secret_versions_to_stages: std::option::Option<
std::collections::HashMap<std::string::String, std::vec::Vec<std::string::String>>,
>,
/// <p>Returns the name of the service that created the secret.</p>
#[doc(hidden)]
pub owning_service: std::option::Option<std::string::String>,
/// <p>The date and time when a secret was created.</p>
#[doc(hidden)]
pub created_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The Region where Secrets Manager originated the secret.</p>
#[doc(hidden)]
pub primary_region: std::option::Option<std::string::String>,
}
impl SecretListEntry {
/// <p>The Amazon Resource Name (ARN) of the secret.</p>
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
/// <p>The friendly name of the secret. You can use forward slashes in the name to represent a path hierarchy. For example, <code>/prod/databases/dbserver1</code> could represent the secret for a server named <code>dbserver1</code> in the folder <code>databases</code> in the folder <code>prod</code>. </p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The user-provided description of the secret.</p>
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The ARN of the KMS key that Secrets Manager uses to encrypt the secret value. If the secret is encrypted with the Amazon Web Services managed key <code>aws/secretsmanager</code>, this field is omitted.</p>
pub fn kms_key_id(&self) -> std::option::Option<&str> {
self.kms_key_id.as_deref()
}
/// <p>Indicates whether automatic, scheduled rotation is enabled for this secret.</p>
pub fn rotation_enabled(&self) -> std::option::Option<bool> {
self.rotation_enabled
}
/// <p>The ARN of an Amazon Web Services Lambda function invoked by Secrets Manager to rotate and expire the secret either automatically per the schedule or manually by a call to <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_RotateSecret.html"> <code>RotateSecret</code> </a>.</p>
pub fn rotation_lambda_arn(&self) -> std::option::Option<&str> {
self.rotation_lambda_arn.as_deref()
}
/// <p>A structure that defines the rotation configuration for the secret.</p>
pub fn rotation_rules(&self) -> std::option::Option<&crate::model::RotationRulesType> {
self.rotation_rules.as_ref()
}
/// <p>The most recent date and time that the Secrets Manager rotation process was successfully completed. This value is null if the secret hasn't ever rotated.</p>
pub fn last_rotated_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_rotated_date.as_ref()
}
/// <p>The last date and time that this secret was modified in any way.</p>
pub fn last_changed_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_changed_date.as_ref()
}
/// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
pub fn last_accessed_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_accessed_date.as_ref()
}
/// <p>The date and time the deletion of the secret occurred. Not present on active secrets. The secret can be recovered until the number of days in the recovery window has passed, as specified in the <code>RecoveryWindowInDays</code> parameter of the <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html"> <code>DeleteSecret</code> </a> operation.</p>
pub fn deleted_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.deleted_date.as_ref()
}
/// <p>The list of user-defined tags associated with the secret. To add tags to a secret, use <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_TagResource.html"> <code>TagResource</code> </a>. To remove tags, use <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_UntagResource.html"> <code>UntagResource</code> </a>.</p>
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
/// <p>A list of all of the currently assigned <code>SecretVersionStage</code> staging labels and the <code>SecretVersionId</code> attached to each one. Staging labels are used to keep track of the different versions during the rotation process.</p> <note>
/// <p>A version that does not have any <code>SecretVersionStage</code> is considered deprecated and subject to deletion. Such versions are not included in this list.</p>
/// </note>
pub fn secret_versions_to_stages(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, std::vec::Vec<std::string::String>>,
> {
self.secret_versions_to_stages.as_ref()
}
/// <p>Returns the name of the service that created the secret.</p>
pub fn owning_service(&self) -> std::option::Option<&str> {
self.owning_service.as_deref()
}
/// <p>The date and time when a secret was created.</p>
pub fn created_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.created_date.as_ref()
}
/// <p>The Region where Secrets Manager originated the secret.</p>
pub fn primary_region(&self) -> std::option::Option<&str> {
self.primary_region.as_deref()
}
}
impl std::fmt::Debug for SecretListEntry {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SecretListEntry");
formatter.field("arn", &self.arn);
formatter.field("name", &self.name);
formatter.field("description", &self.description);
formatter.field("kms_key_id", &self.kms_key_id);
formatter.field("rotation_enabled", &self.rotation_enabled);
formatter.field("rotation_lambda_arn", &self.rotation_lambda_arn);
formatter.field("rotation_rules", &self.rotation_rules);
formatter.field("last_rotated_date", &self.last_rotated_date);
formatter.field("last_changed_date", &self.last_changed_date);
formatter.field("last_accessed_date", &self.last_accessed_date);
formatter.field("deleted_date", &self.deleted_date);
formatter.field("tags", &self.tags);
formatter.field("secret_versions_to_stages", &self.secret_versions_to_stages);
formatter.field("owning_service", &self.owning_service);
formatter.field("created_date", &self.created_date);
formatter.field("primary_region", &self.primary_region);
formatter.finish()
}
}
/// See [`SecretListEntry`](crate::model::SecretListEntry).
pub mod secret_list_entry {
/// A builder for [`SecretListEntry`](crate::model::SecretListEntry).
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) kms_key_id: std::option::Option<std::string::String>,
pub(crate) rotation_enabled: std::option::Option<bool>,
pub(crate) rotation_lambda_arn: std::option::Option<std::string::String>,
pub(crate) rotation_rules: std::option::Option<crate::model::RotationRulesType>,
pub(crate) last_rotated_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) last_changed_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) last_accessed_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) deleted_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) secret_versions_to_stages: std::option::Option<
std::collections::HashMap<std::string::String, std::vec::Vec<std::string::String>>,
>,
pub(crate) owning_service: std::option::Option<std::string::String>,
pub(crate) created_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) primary_region: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The Amazon Resource Name (ARN) of the secret.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the secret.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The friendly name of the secret. You can use forward slashes in the name to represent a path hierarchy. For example, <code>/prod/databases/dbserver1</code> could represent the secret for a server named <code>dbserver1</code> in the folder <code>databases</code> in the folder <code>prod</code>. </p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The friendly name of the secret. You can use forward slashes in the name to represent a path hierarchy. For example, <code>/prod/databases/dbserver1</code> could represent the secret for a server named <code>dbserver1</code> in the folder <code>databases</code> in the folder <code>prod</code>. </p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The user-provided description of the secret.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
/// <p>The user-provided description of the secret.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The ARN of the KMS key that Secrets Manager uses to encrypt the secret value. If the secret is encrypted with the Amazon Web Services managed key <code>aws/secretsmanager</code>, this field is omitted.</p>
pub fn kms_key_id(mut self, input: impl Into<std::string::String>) -> Self {
self.kms_key_id = Some(input.into());
self
}
/// <p>The ARN of the KMS key that Secrets Manager uses to encrypt the secret value. If the secret is encrypted with the Amazon Web Services managed key <code>aws/secretsmanager</code>, this field is omitted.</p>
pub fn set_kms_key_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.kms_key_id = input;
self
}
/// <p>Indicates whether automatic, scheduled rotation is enabled for this secret.</p>
pub fn rotation_enabled(mut self, input: bool) -> Self {
self.rotation_enabled = Some(input);
self
}
/// <p>Indicates whether automatic, scheduled rotation is enabled for this secret.</p>
pub fn set_rotation_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.rotation_enabled = input;
self
}
/// <p>The ARN of an Amazon Web Services Lambda function invoked by Secrets Manager to rotate and expire the secret either automatically per the schedule or manually by a call to <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_RotateSecret.html"> <code>RotateSecret</code> </a>.</p>
pub fn rotation_lambda_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.rotation_lambda_arn = Some(input.into());
self
}
/// <p>The ARN of an Amazon Web Services Lambda function invoked by Secrets Manager to rotate and expire the secret either automatically per the schedule or manually by a call to <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_RotateSecret.html"> <code>RotateSecret</code> </a>.</p>
pub fn set_rotation_lambda_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.rotation_lambda_arn = input;
self
}
/// <p>A structure that defines the rotation configuration for the secret.</p>
pub fn rotation_rules(mut self, input: crate::model::RotationRulesType) -> Self {
self.rotation_rules = Some(input);
self
}
/// <p>A structure that defines the rotation configuration for the secret.</p>
pub fn set_rotation_rules(
mut self,
input: std::option::Option<crate::model::RotationRulesType>,
) -> Self {
self.rotation_rules = input;
self
}
/// <p>The most recent date and time that the Secrets Manager rotation process was successfully completed. This value is null if the secret hasn't ever rotated.</p>
pub fn last_rotated_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_rotated_date = Some(input);
self
}
/// <p>The most recent date and time that the Secrets Manager rotation process was successfully completed. This value is null if the secret hasn't ever rotated.</p>
pub fn set_last_rotated_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_rotated_date = input;
self
}
/// <p>The last date and time that this secret was modified in any way.</p>
pub fn last_changed_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_changed_date = Some(input);
self
}
/// <p>The last date and time that this secret was modified in any way.</p>
pub fn set_last_changed_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_changed_date = input;
self
}
/// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
pub fn last_accessed_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_accessed_date = Some(input);
self
}
/// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
pub fn set_last_accessed_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_accessed_date = input;
self
}
/// <p>The date and time the deletion of the secret occurred. Not present on active secrets. The secret can be recovered until the number of days in the recovery window has passed, as specified in the <code>RecoveryWindowInDays</code> parameter of the <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html"> <code>DeleteSecret</code> </a> operation.</p>
pub fn deleted_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.deleted_date = Some(input);
self
}
/// <p>The date and time the deletion of the secret occurred. Not present on active secrets. The secret can be recovered until the number of days in the recovery window has passed, as specified in the <code>RecoveryWindowInDays</code> parameter of the <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html"> <code>DeleteSecret</code> </a> operation.</p>
pub fn set_deleted_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.deleted_date = input;
self
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The list of user-defined tags associated with the secret. To add tags to a secret, use <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_TagResource.html"> <code>TagResource</code> </a>. To remove tags, use <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_UntagResource.html"> <code>UntagResource</code> </a>.</p>
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
/// <p>The list of user-defined tags associated with the secret. To add tags to a secret, use <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_TagResource.html"> <code>TagResource</code> </a>. To remove tags, use <a href="https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_UntagResource.html"> <code>UntagResource</code> </a>.</p>
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
/// Adds a key-value pair to `secret_versions_to_stages`.
///
/// To override the contents of this collection use [`set_secret_versions_to_stages`](Self::set_secret_versions_to_stages).
///
/// <p>A list of all of the currently assigned <code>SecretVersionStage</code> staging labels and the <code>SecretVersionId</code> attached to each one. Staging labels are used to keep track of the different versions during the rotation process.</p> <note>
/// <p>A version that does not have any <code>SecretVersionStage</code> is considered deprecated and subject to deletion. Such versions are not included in this list.</p>
/// </note>
pub fn secret_versions_to_stages(
mut self,
k: impl Into<std::string::String>,
v: std::vec::Vec<std::string::String>,
) -> Self {
let mut hash_map = self.secret_versions_to_stages.unwrap_or_default();
hash_map.insert(k.into(), v);
self.secret_versions_to_stages = Some(hash_map);
self
}
/// <p>A list of all of the currently assigned <code>SecretVersionStage</code> staging labels and the <code>SecretVersionId</code> attached to each one. Staging labels are used to keep track of the different versions during the rotation process.</p> <note>
/// <p>A version that does not have any <code>SecretVersionStage</code> is considered deprecated and subject to deletion. Such versions are not included in this list.</p>
/// </note>
pub fn set_secret_versions_to_stages(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::vec::Vec<std::string::String>>,
>,
) -> Self {
self.secret_versions_to_stages = input;
self
}
/// <p>Returns the name of the service that created the secret.</p>
pub fn owning_service(mut self, input: impl Into<std::string::String>) -> Self {
self.owning_service = Some(input.into());
self
}
/// <p>Returns the name of the service that created the secret.</p>
pub fn set_owning_service(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.owning_service = input;
self
}
/// <p>The date and time when a secret was created.</p>
pub fn created_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.created_date = Some(input);
self
}
/// <p>The date and time when a secret was created.</p>
pub fn set_created_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.created_date = input;
self
}
/// <p>The Region where Secrets Manager originated the secret.</p>
pub fn primary_region(mut self, input: impl Into<std::string::String>) -> Self {
self.primary_region = Some(input.into());
self
}
/// <p>The Region where Secrets Manager originated the secret.</p>
pub fn set_primary_region(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.primary_region = input;
self
}
/// Consumes the builder and constructs a [`SecretListEntry`](crate::model::SecretListEntry).
pub fn build(self) -> crate::model::SecretListEntry {
crate::model::SecretListEntry {
arn: self.arn,
name: self.name,
description: self.description,
kms_key_id: self.kms_key_id,
rotation_enabled: self.rotation_enabled,
rotation_lambda_arn: self.rotation_lambda_arn,
rotation_rules: self.rotation_rules,
last_rotated_date: self.last_rotated_date,
last_changed_date: self.last_changed_date,
last_accessed_date: self.last_accessed_date,
deleted_date: self.deleted_date,
tags: self.tags,
secret_versions_to_stages: self.secret_versions_to_stages,
owning_service: self.owning_service,
created_date: self.created_date,
primary_region: self.primary_region,
}
}
}
}
impl SecretListEntry {
/// Creates a new builder-style object to manufacture [`SecretListEntry`](crate::model::SecretListEntry).
pub fn builder() -> crate::model::secret_list_entry::Builder {
crate::model::secret_list_entry::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum SortOrderType {
#[allow(missing_docs)] // documentation missing in model
Asc,
#[allow(missing_docs)] // documentation missing in model
Desc,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for SortOrderType {
fn from(s: &str) -> Self {
match s {
"asc" => SortOrderType::Asc,
"desc" => SortOrderType::Desc,
other => SortOrderType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for SortOrderType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(SortOrderType::from(s))
}
}
impl SortOrderType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
SortOrderType::Asc => "asc",
SortOrderType::Desc => "desc",
SortOrderType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["asc", "desc"]
}
}
impl AsRef<str> for SortOrderType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Allows you to add filters when you use the search function in Secrets Manager. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html">Find secrets in Secrets Manager</a>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Filter {
/// <p>The following are keys you can use:</p>
/// <ul>
/// <li> <p> <b>description</b>: Prefix match, not case-sensitive.</p> </li>
/// <li> <p> <b>name</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>tag-key</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>tag-value</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>primary-region</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>all</b>: Breaks the filter value string into words and then searches all attributes for matches. Not case-sensitive.</p> </li>
/// </ul>
#[doc(hidden)]
pub key: std::option::Option<crate::model::FilterNameStringType>,
/// <p>The keyword to filter for.</p>
/// <p>You can prefix your search value with an exclamation mark (<code>!</code>) in order to perform negation filters. </p>
#[doc(hidden)]
pub values: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Filter {
/// <p>The following are keys you can use:</p>
/// <ul>
/// <li> <p> <b>description</b>: Prefix match, not case-sensitive.</p> </li>
/// <li> <p> <b>name</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>tag-key</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>tag-value</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>primary-region</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>all</b>: Breaks the filter value string into words and then searches all attributes for matches. Not case-sensitive.</p> </li>
/// </ul>
pub fn key(&self) -> std::option::Option<&crate::model::FilterNameStringType> {
self.key.as_ref()
}
/// <p>The keyword to filter for.</p>
/// <p>You can prefix your search value with an exclamation mark (<code>!</code>) in order to perform negation filters. </p>
pub fn values(&self) -> std::option::Option<&[std::string::String]> {
self.values.as_deref()
}
}
impl std::fmt::Debug for Filter {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Filter");
formatter.field("key", &self.key);
formatter.field("values", &self.values);
formatter.finish()
}
}
/// See [`Filter`](crate::model::Filter).
pub mod filter {
/// A builder for [`Filter`](crate::model::Filter).
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) key: std::option::Option<crate::model::FilterNameStringType>,
pub(crate) values: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
/// <p>The following are keys you can use:</p>
/// <ul>
/// <li> <p> <b>description</b>: Prefix match, not case-sensitive.</p> </li>
/// <li> <p> <b>name</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>tag-key</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>tag-value</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>primary-region</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>all</b>: Breaks the filter value string into words and then searches all attributes for matches. Not case-sensitive.</p> </li>
/// </ul>
pub fn key(mut self, input: crate::model::FilterNameStringType) -> Self {
self.key = Some(input);
self
}
/// <p>The following are keys you can use:</p>
/// <ul>
/// <li> <p> <b>description</b>: Prefix match, not case-sensitive.</p> </li>
/// <li> <p> <b>name</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>tag-key</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>tag-value</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>primary-region</b>: Prefix match, case-sensitive.</p> </li>
/// <li> <p> <b>all</b>: Breaks the filter value string into words and then searches all attributes for matches. Not case-sensitive.</p> </li>
/// </ul>
pub fn set_key(
mut self,
input: std::option::Option<crate::model::FilterNameStringType>,
) -> Self {
self.key = input;
self
}
/// Appends an item to `values`.
///
/// To override the contents of this collection use [`set_values`](Self::set_values).
///
/// <p>The keyword to filter for.</p>
/// <p>You can prefix your search value with an exclamation mark (<code>!</code>) in order to perform negation filters. </p>
pub fn values(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.values.unwrap_or_default();
v.push(input.into());
self.values = Some(v);
self
}
/// <p>The keyword to filter for.</p>
/// <p>You can prefix your search value with an exclamation mark (<code>!</code>) in order to perform negation filters. </p>
pub fn set_values(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.values = input;
self
}
/// Consumes the builder and constructs a [`Filter`](crate::model::Filter).
pub fn build(self) -> crate::model::Filter {
crate::model::Filter {
key: self.key,
values: self.values,
}
}
}
}
impl Filter {
/// Creates a new builder-style object to manufacture [`Filter`](crate::model::Filter).
pub fn builder() -> crate::model::filter::Builder {
crate::model::filter::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum FilterNameStringType {
#[allow(missing_docs)] // documentation missing in model
All,
#[allow(missing_docs)] // documentation missing in model
Description,
#[allow(missing_docs)] // documentation missing in model
Name,
#[allow(missing_docs)] // documentation missing in model
PrimaryRegion,
#[allow(missing_docs)] // documentation missing in model
TagKey,
#[allow(missing_docs)] // documentation missing in model
TagValue,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for FilterNameStringType {
fn from(s: &str) -> Self {
match s {
"all" => FilterNameStringType::All,
"description" => FilterNameStringType::Description,
"name" => FilterNameStringType::Name,
"primary-region" => FilterNameStringType::PrimaryRegion,
"tag-key" => FilterNameStringType::TagKey,
"tag-value" => FilterNameStringType::TagValue,
other => FilterNameStringType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for FilterNameStringType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(FilterNameStringType::from(s))
}
}
impl FilterNameStringType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
FilterNameStringType::All => "all",
FilterNameStringType::Description => "description",
FilterNameStringType::Name => "name",
FilterNameStringType::PrimaryRegion => "primary-region",
FilterNameStringType::TagKey => "tag-key",
FilterNameStringType::TagValue => "tag-value",
FilterNameStringType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"all",
"description",
"name",
"primary-region",
"tag-key",
"tag-value",
]
}
}
impl AsRef<str> for FilterNameStringType {
fn as_ref(&self) -> &str {
self.as_str()
}
}