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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[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 DialogState {
#[allow(missing_docs)] // documentation missing in model
ConfirmIntent,
#[allow(missing_docs)] // documentation missing in model
ElicitIntent,
#[allow(missing_docs)] // documentation missing in model
ElicitSlot,
#[allow(missing_docs)] // documentation missing in model
Failed,
#[allow(missing_docs)] // documentation missing in model
Fulfilled,
#[allow(missing_docs)] // documentation missing in model
ReadyForFulfillment,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for DialogState {
fn from(s: &str) -> Self {
match s {
"ConfirmIntent" => DialogState::ConfirmIntent,
"ElicitIntent" => DialogState::ElicitIntent,
"ElicitSlot" => DialogState::ElicitSlot,
"Failed" => DialogState::Failed,
"Fulfilled" => DialogState::Fulfilled,
"ReadyForFulfillment" => DialogState::ReadyForFulfillment,
other => DialogState::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for DialogState {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(DialogState::from(s))
}
}
impl DialogState {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
DialogState::ConfirmIntent => "ConfirmIntent",
DialogState::ElicitIntent => "ElicitIntent",
DialogState::ElicitSlot => "ElicitSlot",
DialogState::Failed => "Failed",
DialogState::Fulfilled => "Fulfilled",
DialogState::ReadyForFulfillment => "ReadyForFulfillment",
DialogState::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"ConfirmIntent",
"ElicitIntent",
"ElicitSlot",
"Failed",
"Fulfilled",
"ReadyForFulfillment",
]
}
}
impl AsRef<str> for DialogState {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[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 MessageFormatType {
#[allow(missing_docs)] // documentation missing in model
Composite,
#[allow(missing_docs)] // documentation missing in model
CustomPayload,
#[allow(missing_docs)] // documentation missing in model
PlainText,
#[allow(missing_docs)] // documentation missing in model
Ssml,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for MessageFormatType {
fn from(s: &str) -> Self {
match s {
"Composite" => MessageFormatType::Composite,
"CustomPayload" => MessageFormatType::CustomPayload,
"PlainText" => MessageFormatType::PlainText,
"SSML" => MessageFormatType::Ssml,
other => MessageFormatType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for MessageFormatType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(MessageFormatType::from(s))
}
}
impl MessageFormatType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
MessageFormatType::Composite => "Composite",
MessageFormatType::CustomPayload => "CustomPayload",
MessageFormatType::PlainText => "PlainText",
MessageFormatType::Ssml => "SSML",
MessageFormatType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["Composite", "CustomPayload", "PlainText", "SSML"]
}
}
impl AsRef<str> for MessageFormatType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>A context is a variable that contains information about the current state of the conversation between a user and Amazon Lex. Context can be set automatically by Amazon Lex when an intent is fulfilled, or it can be set at runtime using the <code>PutContent</code>, <code>PutText</code>, or <code>PutSession</code> operation.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ActiveContext {
/// <p>The name of the context.</p>
pub name: std::option::Option<std::string::String>,
/// <p>The length of time or number of turns that a context remains active.</p>
pub time_to_live: std::option::Option<crate::model::ActiveContextTimeToLive>,
/// <p>State variables for the current context. You can use these values as default values for slots in subsequent events.</p>
pub parameters:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl ActiveContext {
/// <p>The name of the context.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The length of time or number of turns that a context remains active.</p>
pub fn time_to_live(&self) -> std::option::Option<&crate::model::ActiveContextTimeToLive> {
self.time_to_live.as_ref()
}
/// <p>State variables for the current context. You can use these values as default values for slots in subsequent events.</p>
pub fn parameters(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.parameters.as_ref()
}
}
impl std::fmt::Debug for ActiveContext {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ActiveContext");
formatter.field("name", &self.name);
formatter.field("time_to_live", &self.time_to_live);
formatter.field("parameters", &self.parameters);
formatter.finish()
}
}
/// See [`ActiveContext`](crate::model::ActiveContext)
pub mod active_context {
/// A builder for [`ActiveContext`](crate::model::ActiveContext)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) time_to_live: std::option::Option<crate::model::ActiveContextTimeToLive>,
pub(crate) parameters: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
/// <p>The name of the context.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the context.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The length of time or number of turns that a context remains active.</p>
pub fn time_to_live(mut self, input: crate::model::ActiveContextTimeToLive) -> Self {
self.time_to_live = Some(input);
self
}
/// <p>The length of time or number of turns that a context remains active.</p>
pub fn set_time_to_live(
mut self,
input: std::option::Option<crate::model::ActiveContextTimeToLive>,
) -> Self {
self.time_to_live = input;
self
}
/// Adds a key-value pair to `parameters`.
///
/// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
///
/// <p>State variables for the current context. You can use these values as default values for slots in subsequent events.</p>
pub fn parameters(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.parameters.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.parameters = Some(hash_map);
self
}
/// <p>State variables for the current context. You can use these values as default values for slots in subsequent events.</p>
pub fn set_parameters(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.parameters = input;
self
}
/// Consumes the builder and constructs a [`ActiveContext`](crate::model::ActiveContext)
pub fn build(self) -> crate::model::ActiveContext {
crate::model::ActiveContext {
name: self.name,
time_to_live: self.time_to_live,
parameters: self.parameters,
}
}
}
}
impl ActiveContext {
/// Creates a new builder-style object to manufacture [`ActiveContext`](crate::model::ActiveContext)
pub fn builder() -> crate::model::active_context::Builder {
crate::model::active_context::Builder::default()
}
}
/// <p>The length of time or number of turns that a context remains active.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ActiveContextTimeToLive {
/// <p>The number of seconds that the context should be active after it is first sent in a <code>PostContent</code> or <code>PostText</code> response. You can set the value between 5 and 86,400 seconds (24 hours).</p>
pub time_to_live_in_seconds: std::option::Option<i32>,
/// <p>The number of conversation turns that the context should be active. A conversation turn is one <code>PostContent</code> or <code>PostText</code> request and the corresponding response from Amazon Lex.</p>
pub turns_to_live: std::option::Option<i32>,
}
impl ActiveContextTimeToLive {
/// <p>The number of seconds that the context should be active after it is first sent in a <code>PostContent</code> or <code>PostText</code> response. You can set the value between 5 and 86,400 seconds (24 hours).</p>
pub fn time_to_live_in_seconds(&self) -> std::option::Option<i32> {
self.time_to_live_in_seconds
}
/// <p>The number of conversation turns that the context should be active. A conversation turn is one <code>PostContent</code> or <code>PostText</code> request and the corresponding response from Amazon Lex.</p>
pub fn turns_to_live(&self) -> std::option::Option<i32> {
self.turns_to_live
}
}
impl std::fmt::Debug for ActiveContextTimeToLive {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ActiveContextTimeToLive");
formatter.field("time_to_live_in_seconds", &self.time_to_live_in_seconds);
formatter.field("turns_to_live", &self.turns_to_live);
formatter.finish()
}
}
/// See [`ActiveContextTimeToLive`](crate::model::ActiveContextTimeToLive)
pub mod active_context_time_to_live {
/// A builder for [`ActiveContextTimeToLive`](crate::model::ActiveContextTimeToLive)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) time_to_live_in_seconds: std::option::Option<i32>,
pub(crate) turns_to_live: std::option::Option<i32>,
}
impl Builder {
/// <p>The number of seconds that the context should be active after it is first sent in a <code>PostContent</code> or <code>PostText</code> response. You can set the value between 5 and 86,400 seconds (24 hours).</p>
pub fn time_to_live_in_seconds(mut self, input: i32) -> Self {
self.time_to_live_in_seconds = Some(input);
self
}
/// <p>The number of seconds that the context should be active after it is first sent in a <code>PostContent</code> or <code>PostText</code> response. You can set the value between 5 and 86,400 seconds (24 hours).</p>
pub fn set_time_to_live_in_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.time_to_live_in_seconds = input;
self
}
/// <p>The number of conversation turns that the context should be active. A conversation turn is one <code>PostContent</code> or <code>PostText</code> request and the corresponding response from Amazon Lex.</p>
pub fn turns_to_live(mut self, input: i32) -> Self {
self.turns_to_live = Some(input);
self
}
/// <p>The number of conversation turns that the context should be active. A conversation turn is one <code>PostContent</code> or <code>PostText</code> request and the corresponding response from Amazon Lex.</p>
pub fn set_turns_to_live(mut self, input: std::option::Option<i32>) -> Self {
self.turns_to_live = input;
self
}
/// Consumes the builder and constructs a [`ActiveContextTimeToLive`](crate::model::ActiveContextTimeToLive)
pub fn build(self) -> crate::model::ActiveContextTimeToLive {
crate::model::ActiveContextTimeToLive {
time_to_live_in_seconds: self.time_to_live_in_seconds,
turns_to_live: self.turns_to_live,
}
}
}
}
impl ActiveContextTimeToLive {
/// Creates a new builder-style object to manufacture [`ActiveContextTimeToLive`](crate::model::ActiveContextTimeToLive)
pub fn builder() -> crate::model::active_context_time_to_live::Builder {
crate::model::active_context_time_to_live::Builder::default()
}
}
/// <p>Provides information about the state of an intent. You can use this information to get the current state of an intent so that you can process the intent, or so that you can return the intent to its previous state.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IntentSummary {
/// <p>The name of the intent.</p>
pub intent_name: std::option::Option<std::string::String>,
/// <p>A user-defined label that identifies a particular intent. You can use this label to return to a previous intent. </p>
/// <p>Use the <code>checkpointLabelFilter</code> parameter of the <code>GetSessionRequest</code> operation to filter the intents returned by the operation to those with only the specified label.</p>
pub checkpoint_label: std::option::Option<std::string::String>,
/// <p>Map of the slots that have been gathered and their values. </p>
pub slots:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
/// <p>The status of the intent after the user responds to the confirmation prompt. If the user confirms the intent, Amazon Lex sets this field to <code>Confirmed</code>. If the user denies the intent, Amazon Lex sets this value to <code>Denied</code>. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Confirmed</code> - The user has responded "Yes" to the confirmation prompt, confirming that the intent is complete and that it is ready to be fulfilled.</p> </li>
/// <li> <p> <code>Denied</code> - The user has responded "No" to the confirmation prompt.</p> </li>
/// <li> <p> <code>None</code> - The user has never been prompted for confirmation; or, the user was prompted but did not confirm or deny the prompt.</p> </li>
/// </ul>
pub confirmation_status: std::option::Option<crate::model::ConfirmationStatus>,
/// <p>The next action that the bot should take in its interaction with the user. The possible values are:</p>
/// <ul>
/// <li> <p> <code>ConfirmIntent</code> - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"</p> </li>
/// <li> <p> <code>Close</code> - Indicates that the there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.</p> </li>
/// <li> <p> <code>ElicitIntent</code> - The next action is to determine the intent that the user wants to fulfill.</p> </li>
/// <li> <p> <code>ElicitSlot</code> - The next action is to elicit a slot value from the user.</p> </li>
/// </ul>
pub dialog_action_type: std::option::Option<crate::model::DialogActionType>,
/// <p>The fulfillment state of the intent. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Failed</code> - The Lambda function associated with the intent failed to fulfill the intent.</p> </li>
/// <li> <p> <code>Fulfilled</code> - The intent has fulfilled by the Lambda function associated with the intent. </p> </li>
/// <li> <p> <code>ReadyForFulfillment</code> - All of the information necessary for the intent is present and the intent ready to be fulfilled by the client application.</p> </li>
/// </ul>
pub fulfillment_state: std::option::Option<crate::model::FulfillmentState>,
/// <p>The next slot to elicit from the user. If there is not slot to elicit, the field is blank.</p>
pub slot_to_elicit: std::option::Option<std::string::String>,
}
impl IntentSummary {
/// <p>The name of the intent.</p>
pub fn intent_name(&self) -> std::option::Option<&str> {
self.intent_name.as_deref()
}
/// <p>A user-defined label that identifies a particular intent. You can use this label to return to a previous intent. </p>
/// <p>Use the <code>checkpointLabelFilter</code> parameter of the <code>GetSessionRequest</code> operation to filter the intents returned by the operation to those with only the specified label.</p>
pub fn checkpoint_label(&self) -> std::option::Option<&str> {
self.checkpoint_label.as_deref()
}
/// <p>Map of the slots that have been gathered and their values. </p>
pub fn slots(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.slots.as_ref()
}
/// <p>The status of the intent after the user responds to the confirmation prompt. If the user confirms the intent, Amazon Lex sets this field to <code>Confirmed</code>. If the user denies the intent, Amazon Lex sets this value to <code>Denied</code>. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Confirmed</code> - The user has responded "Yes" to the confirmation prompt, confirming that the intent is complete and that it is ready to be fulfilled.</p> </li>
/// <li> <p> <code>Denied</code> - The user has responded "No" to the confirmation prompt.</p> </li>
/// <li> <p> <code>None</code> - The user has never been prompted for confirmation; or, the user was prompted but did not confirm or deny the prompt.</p> </li>
/// </ul>
pub fn confirmation_status(&self) -> std::option::Option<&crate::model::ConfirmationStatus> {
self.confirmation_status.as_ref()
}
/// <p>The next action that the bot should take in its interaction with the user. The possible values are:</p>
/// <ul>
/// <li> <p> <code>ConfirmIntent</code> - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"</p> </li>
/// <li> <p> <code>Close</code> - Indicates that the there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.</p> </li>
/// <li> <p> <code>ElicitIntent</code> - The next action is to determine the intent that the user wants to fulfill.</p> </li>
/// <li> <p> <code>ElicitSlot</code> - The next action is to elicit a slot value from the user.</p> </li>
/// </ul>
pub fn dialog_action_type(&self) -> std::option::Option<&crate::model::DialogActionType> {
self.dialog_action_type.as_ref()
}
/// <p>The fulfillment state of the intent. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Failed</code> - The Lambda function associated with the intent failed to fulfill the intent.</p> </li>
/// <li> <p> <code>Fulfilled</code> - The intent has fulfilled by the Lambda function associated with the intent. </p> </li>
/// <li> <p> <code>ReadyForFulfillment</code> - All of the information necessary for the intent is present and the intent ready to be fulfilled by the client application.</p> </li>
/// </ul>
pub fn fulfillment_state(&self) -> std::option::Option<&crate::model::FulfillmentState> {
self.fulfillment_state.as_ref()
}
/// <p>The next slot to elicit from the user. If there is not slot to elicit, the field is blank.</p>
pub fn slot_to_elicit(&self) -> std::option::Option<&str> {
self.slot_to_elicit.as_deref()
}
}
impl std::fmt::Debug for IntentSummary {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("IntentSummary");
formatter.field("intent_name", &self.intent_name);
formatter.field("checkpoint_label", &self.checkpoint_label);
formatter.field("slots", &"*** Sensitive Data Redacted ***");
formatter.field("confirmation_status", &self.confirmation_status);
formatter.field("dialog_action_type", &self.dialog_action_type);
formatter.field("fulfillment_state", &self.fulfillment_state);
formatter.field("slot_to_elicit", &self.slot_to_elicit);
formatter.finish()
}
}
/// See [`IntentSummary`](crate::model::IntentSummary)
pub mod intent_summary {
/// A builder for [`IntentSummary`](crate::model::IntentSummary)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) intent_name: std::option::Option<std::string::String>,
pub(crate) checkpoint_label: std::option::Option<std::string::String>,
pub(crate) slots: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) confirmation_status: std::option::Option<crate::model::ConfirmationStatus>,
pub(crate) dialog_action_type: std::option::Option<crate::model::DialogActionType>,
pub(crate) fulfillment_state: std::option::Option<crate::model::FulfillmentState>,
pub(crate) slot_to_elicit: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the intent.</p>
pub fn intent_name(mut self, input: impl Into<std::string::String>) -> Self {
self.intent_name = Some(input.into());
self
}
/// <p>The name of the intent.</p>
pub fn set_intent_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.intent_name = input;
self
}
/// <p>A user-defined label that identifies a particular intent. You can use this label to return to a previous intent. </p>
/// <p>Use the <code>checkpointLabelFilter</code> parameter of the <code>GetSessionRequest</code> operation to filter the intents returned by the operation to those with only the specified label.</p>
pub fn checkpoint_label(mut self, input: impl Into<std::string::String>) -> Self {
self.checkpoint_label = Some(input.into());
self
}
/// <p>A user-defined label that identifies a particular intent. You can use this label to return to a previous intent. </p>
/// <p>Use the <code>checkpointLabelFilter</code> parameter of the <code>GetSessionRequest</code> operation to filter the intents returned by the operation to those with only the specified label.</p>
pub fn set_checkpoint_label(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.checkpoint_label = input;
self
}
/// Adds a key-value pair to `slots`.
///
/// To override the contents of this collection use [`set_slots`](Self::set_slots).
///
/// <p>Map of the slots that have been gathered and their values. </p>
pub fn slots(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.slots.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.slots = Some(hash_map);
self
}
/// <p>Map of the slots that have been gathered and their values. </p>
pub fn set_slots(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.slots = input;
self
}
/// <p>The status of the intent after the user responds to the confirmation prompt. If the user confirms the intent, Amazon Lex sets this field to <code>Confirmed</code>. If the user denies the intent, Amazon Lex sets this value to <code>Denied</code>. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Confirmed</code> - The user has responded "Yes" to the confirmation prompt, confirming that the intent is complete and that it is ready to be fulfilled.</p> </li>
/// <li> <p> <code>Denied</code> - The user has responded "No" to the confirmation prompt.</p> </li>
/// <li> <p> <code>None</code> - The user has never been prompted for confirmation; or, the user was prompted but did not confirm or deny the prompt.</p> </li>
/// </ul>
pub fn confirmation_status(mut self, input: crate::model::ConfirmationStatus) -> Self {
self.confirmation_status = Some(input);
self
}
/// <p>The status of the intent after the user responds to the confirmation prompt. If the user confirms the intent, Amazon Lex sets this field to <code>Confirmed</code>. If the user denies the intent, Amazon Lex sets this value to <code>Denied</code>. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Confirmed</code> - The user has responded "Yes" to the confirmation prompt, confirming that the intent is complete and that it is ready to be fulfilled.</p> </li>
/// <li> <p> <code>Denied</code> - The user has responded "No" to the confirmation prompt.</p> </li>
/// <li> <p> <code>None</code> - The user has never been prompted for confirmation; or, the user was prompted but did not confirm or deny the prompt.</p> </li>
/// </ul>
pub fn set_confirmation_status(
mut self,
input: std::option::Option<crate::model::ConfirmationStatus>,
) -> Self {
self.confirmation_status = input;
self
}
/// <p>The next action that the bot should take in its interaction with the user. The possible values are:</p>
/// <ul>
/// <li> <p> <code>ConfirmIntent</code> - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"</p> </li>
/// <li> <p> <code>Close</code> - Indicates that the there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.</p> </li>
/// <li> <p> <code>ElicitIntent</code> - The next action is to determine the intent that the user wants to fulfill.</p> </li>
/// <li> <p> <code>ElicitSlot</code> - The next action is to elicit a slot value from the user.</p> </li>
/// </ul>
pub fn dialog_action_type(mut self, input: crate::model::DialogActionType) -> Self {
self.dialog_action_type = Some(input);
self
}
/// <p>The next action that the bot should take in its interaction with the user. The possible values are:</p>
/// <ul>
/// <li> <p> <code>ConfirmIntent</code> - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"</p> </li>
/// <li> <p> <code>Close</code> - Indicates that the there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.</p> </li>
/// <li> <p> <code>ElicitIntent</code> - The next action is to determine the intent that the user wants to fulfill.</p> </li>
/// <li> <p> <code>ElicitSlot</code> - The next action is to elicit a slot value from the user.</p> </li>
/// </ul>
pub fn set_dialog_action_type(
mut self,
input: std::option::Option<crate::model::DialogActionType>,
) -> Self {
self.dialog_action_type = input;
self
}
/// <p>The fulfillment state of the intent. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Failed</code> - The Lambda function associated with the intent failed to fulfill the intent.</p> </li>
/// <li> <p> <code>Fulfilled</code> - The intent has fulfilled by the Lambda function associated with the intent. </p> </li>
/// <li> <p> <code>ReadyForFulfillment</code> - All of the information necessary for the intent is present and the intent ready to be fulfilled by the client application.</p> </li>
/// </ul>
pub fn fulfillment_state(mut self, input: crate::model::FulfillmentState) -> Self {
self.fulfillment_state = Some(input);
self
}
/// <p>The fulfillment state of the intent. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Failed</code> - The Lambda function associated with the intent failed to fulfill the intent.</p> </li>
/// <li> <p> <code>Fulfilled</code> - The intent has fulfilled by the Lambda function associated with the intent. </p> </li>
/// <li> <p> <code>ReadyForFulfillment</code> - All of the information necessary for the intent is present and the intent ready to be fulfilled by the client application.</p> </li>
/// </ul>
pub fn set_fulfillment_state(
mut self,
input: std::option::Option<crate::model::FulfillmentState>,
) -> Self {
self.fulfillment_state = input;
self
}
/// <p>The next slot to elicit from the user. If there is not slot to elicit, the field is blank.</p>
pub fn slot_to_elicit(mut self, input: impl Into<std::string::String>) -> Self {
self.slot_to_elicit = Some(input.into());
self
}
/// <p>The next slot to elicit from the user. If there is not slot to elicit, the field is blank.</p>
pub fn set_slot_to_elicit(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.slot_to_elicit = input;
self
}
/// Consumes the builder and constructs a [`IntentSummary`](crate::model::IntentSummary)
pub fn build(self) -> crate::model::IntentSummary {
crate::model::IntentSummary {
intent_name: self.intent_name,
checkpoint_label: self.checkpoint_label,
slots: self.slots,
confirmation_status: self.confirmation_status,
dialog_action_type: self.dialog_action_type,
fulfillment_state: self.fulfillment_state,
slot_to_elicit: self.slot_to_elicit,
}
}
}
}
impl IntentSummary {
/// Creates a new builder-style object to manufacture [`IntentSummary`](crate::model::IntentSummary)
pub fn builder() -> crate::model::intent_summary::Builder {
crate::model::intent_summary::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 FulfillmentState {
#[allow(missing_docs)] // documentation missing in model
Failed,
#[allow(missing_docs)] // documentation missing in model
Fulfilled,
#[allow(missing_docs)] // documentation missing in model
ReadyForFulfillment,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for FulfillmentState {
fn from(s: &str) -> Self {
match s {
"Failed" => FulfillmentState::Failed,
"Fulfilled" => FulfillmentState::Fulfilled,
"ReadyForFulfillment" => FulfillmentState::ReadyForFulfillment,
other => FulfillmentState::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for FulfillmentState {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(FulfillmentState::from(s))
}
}
impl FulfillmentState {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
FulfillmentState::Failed => "Failed",
FulfillmentState::Fulfilled => "Fulfilled",
FulfillmentState::ReadyForFulfillment => "ReadyForFulfillment",
FulfillmentState::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["Failed", "Fulfilled", "ReadyForFulfillment"]
}
}
impl AsRef<str> for FulfillmentState {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[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 DialogActionType {
#[allow(missing_docs)] // documentation missing in model
Close,
#[allow(missing_docs)] // documentation missing in model
ConfirmIntent,
#[allow(missing_docs)] // documentation missing in model
Delegate,
#[allow(missing_docs)] // documentation missing in model
ElicitIntent,
#[allow(missing_docs)] // documentation missing in model
ElicitSlot,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for DialogActionType {
fn from(s: &str) -> Self {
match s {
"Close" => DialogActionType::Close,
"ConfirmIntent" => DialogActionType::ConfirmIntent,
"Delegate" => DialogActionType::Delegate,
"ElicitIntent" => DialogActionType::ElicitIntent,
"ElicitSlot" => DialogActionType::ElicitSlot,
other => DialogActionType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for DialogActionType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(DialogActionType::from(s))
}
}
impl DialogActionType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
DialogActionType::Close => "Close",
DialogActionType::ConfirmIntent => "ConfirmIntent",
DialogActionType::Delegate => "Delegate",
DialogActionType::ElicitIntent => "ElicitIntent",
DialogActionType::ElicitSlot => "ElicitSlot",
DialogActionType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"Close",
"ConfirmIntent",
"Delegate",
"ElicitIntent",
"ElicitSlot",
]
}
}
impl AsRef<str> for DialogActionType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[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 ConfirmationStatus {
#[allow(missing_docs)] // documentation missing in model
Confirmed,
#[allow(missing_docs)] // documentation missing in model
Denied,
#[allow(missing_docs)] // documentation missing in model
None,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ConfirmationStatus {
fn from(s: &str) -> Self {
match s {
"Confirmed" => ConfirmationStatus::Confirmed,
"Denied" => ConfirmationStatus::Denied,
"None" => ConfirmationStatus::None,
other => ConfirmationStatus::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ConfirmationStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ConfirmationStatus::from(s))
}
}
impl ConfirmationStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ConfirmationStatus::Confirmed => "Confirmed",
ConfirmationStatus::Denied => "Denied",
ConfirmationStatus::None => "None",
ConfirmationStatus::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["Confirmed", "Denied", "None"]
}
}
impl AsRef<str> for ConfirmationStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes the next action that the bot should take in its interaction with the user and provides information about the context in which the action takes place. Use the <code>DialogAction</code> data type to set the interaction to a specific state, or to return the interaction to a previous state.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DialogAction {
/// <p>The next action that the bot should take in its interaction with the user. The possible values are:</p>
/// <ul>
/// <li> <p> <code>ConfirmIntent</code> - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"</p> </li>
/// <li> <p> <code>Close</code> - Indicates that the there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.</p> </li>
/// <li> <p> <code>Delegate</code> - The next action is determined by Amazon Lex.</p> </li>
/// <li> <p> <code>ElicitIntent</code> - The next action is to determine the intent that the user wants to fulfill.</p> </li>
/// <li> <p> <code>ElicitSlot</code> - The next action is to elicit a slot value from the user.</p> </li>
/// </ul>
pub r#type: std::option::Option<crate::model::DialogActionType>,
/// <p>The name of the intent.</p>
pub intent_name: std::option::Option<std::string::String>,
/// <p>Map of the slots that have been gathered and their values. </p>
pub slots:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
/// <p>The name of the slot that should be elicited from the user.</p>
pub slot_to_elicit: std::option::Option<std::string::String>,
/// <p>The fulfillment state of the intent. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Failed</code> - The Lambda function associated with the intent failed to fulfill the intent.</p> </li>
/// <li> <p> <code>Fulfilled</code> - The intent has fulfilled by the Lambda function associated with the intent. </p> </li>
/// <li> <p> <code>ReadyForFulfillment</code> - All of the information necessary for the intent is present and the intent ready to be fulfilled by the client application.</p> </li>
/// </ul>
pub fulfillment_state: std::option::Option<crate::model::FulfillmentState>,
/// <p>The message that should be shown to the user. If you don't specify a message, Amazon Lex will use the message configured for the intent.</p>
pub message: std::option::Option<std::string::String>,
/// <ul>
/// <li> <p> <code>PlainText</code> - The message contains plain UTF-8 text.</p> </li>
/// <li> <p> <code>CustomPayload</code> - The message is a custom format for the client.</p> </li>
/// <li> <p> <code>SSML</code> - The message contains text formatted for voice output.</p> </li>
/// <li> <p> <code>Composite</code> - The message contains an escaped JSON object containing one or more messages. For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/howitworks-manage-prompts.html">Message Groups</a>. </p> </li>
/// </ul>
pub message_format: std::option::Option<crate::model::MessageFormatType>,
}
impl DialogAction {
/// <p>The next action that the bot should take in its interaction with the user. The possible values are:</p>
/// <ul>
/// <li> <p> <code>ConfirmIntent</code> - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"</p> </li>
/// <li> <p> <code>Close</code> - Indicates that the there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.</p> </li>
/// <li> <p> <code>Delegate</code> - The next action is determined by Amazon Lex.</p> </li>
/// <li> <p> <code>ElicitIntent</code> - The next action is to determine the intent that the user wants to fulfill.</p> </li>
/// <li> <p> <code>ElicitSlot</code> - The next action is to elicit a slot value from the user.</p> </li>
/// </ul>
pub fn r#type(&self) -> std::option::Option<&crate::model::DialogActionType> {
self.r#type.as_ref()
}
/// <p>The name of the intent.</p>
pub fn intent_name(&self) -> std::option::Option<&str> {
self.intent_name.as_deref()
}
/// <p>Map of the slots that have been gathered and their values. </p>
pub fn slots(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.slots.as_ref()
}
/// <p>The name of the slot that should be elicited from the user.</p>
pub fn slot_to_elicit(&self) -> std::option::Option<&str> {
self.slot_to_elicit.as_deref()
}
/// <p>The fulfillment state of the intent. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Failed</code> - The Lambda function associated with the intent failed to fulfill the intent.</p> </li>
/// <li> <p> <code>Fulfilled</code> - The intent has fulfilled by the Lambda function associated with the intent. </p> </li>
/// <li> <p> <code>ReadyForFulfillment</code> - All of the information necessary for the intent is present and the intent ready to be fulfilled by the client application.</p> </li>
/// </ul>
pub fn fulfillment_state(&self) -> std::option::Option<&crate::model::FulfillmentState> {
self.fulfillment_state.as_ref()
}
/// <p>The message that should be shown to the user. If you don't specify a message, Amazon Lex will use the message configured for the intent.</p>
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
/// <ul>
/// <li> <p> <code>PlainText</code> - The message contains plain UTF-8 text.</p> </li>
/// <li> <p> <code>CustomPayload</code> - The message is a custom format for the client.</p> </li>
/// <li> <p> <code>SSML</code> - The message contains text formatted for voice output.</p> </li>
/// <li> <p> <code>Composite</code> - The message contains an escaped JSON object containing one or more messages. For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/howitworks-manage-prompts.html">Message Groups</a>. </p> </li>
/// </ul>
pub fn message_format(&self) -> std::option::Option<&crate::model::MessageFormatType> {
self.message_format.as_ref()
}
}
impl std::fmt::Debug for DialogAction {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DialogAction");
formatter.field("r#type", &self.r#type);
formatter.field("intent_name", &self.intent_name);
formatter.field("slots", &"*** Sensitive Data Redacted ***");
formatter.field("slot_to_elicit", &self.slot_to_elicit);
formatter.field("fulfillment_state", &self.fulfillment_state);
formatter.field("message", &"*** Sensitive Data Redacted ***");
formatter.field("message_format", &self.message_format);
formatter.finish()
}
}
/// See [`DialogAction`](crate::model::DialogAction)
pub mod dialog_action {
/// A builder for [`DialogAction`](crate::model::DialogAction)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) r#type: std::option::Option<crate::model::DialogActionType>,
pub(crate) intent_name: std::option::Option<std::string::String>,
pub(crate) slots: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) slot_to_elicit: std::option::Option<std::string::String>,
pub(crate) fulfillment_state: std::option::Option<crate::model::FulfillmentState>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) message_format: std::option::Option<crate::model::MessageFormatType>,
}
impl Builder {
/// <p>The next action that the bot should take in its interaction with the user. The possible values are:</p>
/// <ul>
/// <li> <p> <code>ConfirmIntent</code> - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"</p> </li>
/// <li> <p> <code>Close</code> - Indicates that the there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.</p> </li>
/// <li> <p> <code>Delegate</code> - The next action is determined by Amazon Lex.</p> </li>
/// <li> <p> <code>ElicitIntent</code> - The next action is to determine the intent that the user wants to fulfill.</p> </li>
/// <li> <p> <code>ElicitSlot</code> - The next action is to elicit a slot value from the user.</p> </li>
/// </ul>
pub fn r#type(mut self, input: crate::model::DialogActionType) -> Self {
self.r#type = Some(input);
self
}
/// <p>The next action that the bot should take in its interaction with the user. The possible values are:</p>
/// <ul>
/// <li> <p> <code>ConfirmIntent</code> - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"</p> </li>
/// <li> <p> <code>Close</code> - Indicates that the there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.</p> </li>
/// <li> <p> <code>Delegate</code> - The next action is determined by Amazon Lex.</p> </li>
/// <li> <p> <code>ElicitIntent</code> - The next action is to determine the intent that the user wants to fulfill.</p> </li>
/// <li> <p> <code>ElicitSlot</code> - The next action is to elicit a slot value from the user.</p> </li>
/// </ul>
pub fn set_type(
mut self,
input: std::option::Option<crate::model::DialogActionType>,
) -> Self {
self.r#type = input;
self
}
/// <p>The name of the intent.</p>
pub fn intent_name(mut self, input: impl Into<std::string::String>) -> Self {
self.intent_name = Some(input.into());
self
}
/// <p>The name of the intent.</p>
pub fn set_intent_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.intent_name = input;
self
}
/// Adds a key-value pair to `slots`.
///
/// To override the contents of this collection use [`set_slots`](Self::set_slots).
///
/// <p>Map of the slots that have been gathered and their values. </p>
pub fn slots(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.slots.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.slots = Some(hash_map);
self
}
/// <p>Map of the slots that have been gathered and their values. </p>
pub fn set_slots(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.slots = input;
self
}
/// <p>The name of the slot that should be elicited from the user.</p>
pub fn slot_to_elicit(mut self, input: impl Into<std::string::String>) -> Self {
self.slot_to_elicit = Some(input.into());
self
}
/// <p>The name of the slot that should be elicited from the user.</p>
pub fn set_slot_to_elicit(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.slot_to_elicit = input;
self
}
/// <p>The fulfillment state of the intent. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Failed</code> - The Lambda function associated with the intent failed to fulfill the intent.</p> </li>
/// <li> <p> <code>Fulfilled</code> - The intent has fulfilled by the Lambda function associated with the intent. </p> </li>
/// <li> <p> <code>ReadyForFulfillment</code> - All of the information necessary for the intent is present and the intent ready to be fulfilled by the client application.</p> </li>
/// </ul>
pub fn fulfillment_state(mut self, input: crate::model::FulfillmentState) -> Self {
self.fulfillment_state = Some(input);
self
}
/// <p>The fulfillment state of the intent. The possible values are:</p>
/// <ul>
/// <li> <p> <code>Failed</code> - The Lambda function associated with the intent failed to fulfill the intent.</p> </li>
/// <li> <p> <code>Fulfilled</code> - The intent has fulfilled by the Lambda function associated with the intent. </p> </li>
/// <li> <p> <code>ReadyForFulfillment</code> - All of the information necessary for the intent is present and the intent ready to be fulfilled by the client application.</p> </li>
/// </ul>
pub fn set_fulfillment_state(
mut self,
input: std::option::Option<crate::model::FulfillmentState>,
) -> Self {
self.fulfillment_state = input;
self
}
/// <p>The message that should be shown to the user. If you don't specify a message, Amazon Lex will use the message configured for the intent.</p>
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
/// <p>The message that should be shown to the user. If you don't specify a message, Amazon Lex will use the message configured for the intent.</p>
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// <ul>
/// <li> <p> <code>PlainText</code> - The message contains plain UTF-8 text.</p> </li>
/// <li> <p> <code>CustomPayload</code> - The message is a custom format for the client.</p> </li>
/// <li> <p> <code>SSML</code> - The message contains text formatted for voice output.</p> </li>
/// <li> <p> <code>Composite</code> - The message contains an escaped JSON object containing one or more messages. For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/howitworks-manage-prompts.html">Message Groups</a>. </p> </li>
/// </ul>
pub fn message_format(mut self, input: crate::model::MessageFormatType) -> Self {
self.message_format = Some(input);
self
}
/// <ul>
/// <li> <p> <code>PlainText</code> - The message contains plain UTF-8 text.</p> </li>
/// <li> <p> <code>CustomPayload</code> - The message is a custom format for the client.</p> </li>
/// <li> <p> <code>SSML</code> - The message contains text formatted for voice output.</p> </li>
/// <li> <p> <code>Composite</code> - The message contains an escaped JSON object containing one or more messages. For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/howitworks-manage-prompts.html">Message Groups</a>. </p> </li>
/// </ul>
pub fn set_message_format(
mut self,
input: std::option::Option<crate::model::MessageFormatType>,
) -> Self {
self.message_format = input;
self
}
/// Consumes the builder and constructs a [`DialogAction`](crate::model::DialogAction)
pub fn build(self) -> crate::model::DialogAction {
crate::model::DialogAction {
r#type: self.r#type,
intent_name: self.intent_name,
slots: self.slots,
slot_to_elicit: self.slot_to_elicit,
fulfillment_state: self.fulfillment_state,
message: self.message,
message_format: self.message_format,
}
}
}
}
impl DialogAction {
/// Creates a new builder-style object to manufacture [`DialogAction`](crate::model::DialogAction)
pub fn builder() -> crate::model::dialog_action::Builder {
crate::model::dialog_action::Builder::default()
}
}
/// <p>If you configure a response card when creating your bots, Amazon Lex substitutes the session attributes and slot values that are available, and then returns it. The response card can also come from a Lambda function ( <code>dialogCodeHook</code> and <code>fulfillmentActivity</code> on an intent).</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ResponseCard {
/// <p>The version of the response card format.</p>
pub version: std::option::Option<std::string::String>,
/// <p>The content type of the response.</p>
pub content_type: std::option::Option<crate::model::ContentType>,
/// <p>An array of attachment objects representing options.</p>
pub generic_attachments: std::option::Option<std::vec::Vec<crate::model::GenericAttachment>>,
}
impl ResponseCard {
/// <p>The version of the response card format.</p>
pub fn version(&self) -> std::option::Option<&str> {
self.version.as_deref()
}
/// <p>The content type of the response.</p>
pub fn content_type(&self) -> std::option::Option<&crate::model::ContentType> {
self.content_type.as_ref()
}
/// <p>An array of attachment objects representing options.</p>
pub fn generic_attachments(&self) -> std::option::Option<&[crate::model::GenericAttachment]> {
self.generic_attachments.as_deref()
}
}
impl std::fmt::Debug for ResponseCard {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ResponseCard");
formatter.field("version", &self.version);
formatter.field("content_type", &self.content_type);
formatter.field("generic_attachments", &self.generic_attachments);
formatter.finish()
}
}
/// See [`ResponseCard`](crate::model::ResponseCard)
pub mod response_card {
/// A builder for [`ResponseCard`](crate::model::ResponseCard)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) version: std::option::Option<std::string::String>,
pub(crate) content_type: std::option::Option<crate::model::ContentType>,
pub(crate) generic_attachments:
std::option::Option<std::vec::Vec<crate::model::GenericAttachment>>,
}
impl Builder {
/// <p>The version of the response card format.</p>
pub fn version(mut self, input: impl Into<std::string::String>) -> Self {
self.version = Some(input.into());
self
}
/// <p>The version of the response card format.</p>
pub fn set_version(mut self, input: std::option::Option<std::string::String>) -> Self {
self.version = input;
self
}
/// <p>The content type of the response.</p>
pub fn content_type(mut self, input: crate::model::ContentType) -> Self {
self.content_type = Some(input);
self
}
/// <p>The content type of the response.</p>
pub fn set_content_type(
mut self,
input: std::option::Option<crate::model::ContentType>,
) -> Self {
self.content_type = input;
self
}
/// Appends an item to `generic_attachments`.
///
/// To override the contents of this collection use [`set_generic_attachments`](Self::set_generic_attachments).
///
/// <p>An array of attachment objects representing options.</p>
pub fn generic_attachments(mut self, input: crate::model::GenericAttachment) -> Self {
let mut v = self.generic_attachments.unwrap_or_default();
v.push(input);
self.generic_attachments = Some(v);
self
}
/// <p>An array of attachment objects representing options.</p>
pub fn set_generic_attachments(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::GenericAttachment>>,
) -> Self {
self.generic_attachments = input;
self
}
/// Consumes the builder and constructs a [`ResponseCard`](crate::model::ResponseCard)
pub fn build(self) -> crate::model::ResponseCard {
crate::model::ResponseCard {
version: self.version,
content_type: self.content_type,
generic_attachments: self.generic_attachments,
}
}
}
}
impl ResponseCard {
/// Creates a new builder-style object to manufacture [`ResponseCard`](crate::model::ResponseCard)
pub fn builder() -> crate::model::response_card::Builder {
crate::model::response_card::Builder::default()
}
}
/// <p>Represents an option rendered to the user when a prompt is shown. It could be an image, a button, a link, or text. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GenericAttachment {
/// <p>The title of the option.</p>
pub title: std::option::Option<std::string::String>,
/// <p>The subtitle shown below the title.</p>
pub sub_title: std::option::Option<std::string::String>,
/// <p>The URL of an attachment to the response card.</p>
pub attachment_link_url: std::option::Option<std::string::String>,
/// <p>The URL of an image that is displayed to the user.</p>
pub image_url: std::option::Option<std::string::String>,
/// <p>The list of options to show to the user.</p>
pub buttons: std::option::Option<std::vec::Vec<crate::model::Button>>,
}
impl GenericAttachment {
/// <p>The title of the option.</p>
pub fn title(&self) -> std::option::Option<&str> {
self.title.as_deref()
}
/// <p>The subtitle shown below the title.</p>
pub fn sub_title(&self) -> std::option::Option<&str> {
self.sub_title.as_deref()
}
/// <p>The URL of an attachment to the response card.</p>
pub fn attachment_link_url(&self) -> std::option::Option<&str> {
self.attachment_link_url.as_deref()
}
/// <p>The URL of an image that is displayed to the user.</p>
pub fn image_url(&self) -> std::option::Option<&str> {
self.image_url.as_deref()
}
/// <p>The list of options to show to the user.</p>
pub fn buttons(&self) -> std::option::Option<&[crate::model::Button]> {
self.buttons.as_deref()
}
}
impl std::fmt::Debug for GenericAttachment {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GenericAttachment");
formatter.field("title", &self.title);
formatter.field("sub_title", &self.sub_title);
formatter.field("attachment_link_url", &self.attachment_link_url);
formatter.field("image_url", &self.image_url);
formatter.field("buttons", &self.buttons);
formatter.finish()
}
}
/// See [`GenericAttachment`](crate::model::GenericAttachment)
pub mod generic_attachment {
/// A builder for [`GenericAttachment`](crate::model::GenericAttachment)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) title: std::option::Option<std::string::String>,
pub(crate) sub_title: std::option::Option<std::string::String>,
pub(crate) attachment_link_url: std::option::Option<std::string::String>,
pub(crate) image_url: std::option::Option<std::string::String>,
pub(crate) buttons: std::option::Option<std::vec::Vec<crate::model::Button>>,
}
impl Builder {
/// <p>The title of the option.</p>
pub fn title(mut self, input: impl Into<std::string::String>) -> Self {
self.title = Some(input.into());
self
}
/// <p>The title of the option.</p>
pub fn set_title(mut self, input: std::option::Option<std::string::String>) -> Self {
self.title = input;
self
}
/// <p>The subtitle shown below the title.</p>
pub fn sub_title(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_title = Some(input.into());
self
}
/// <p>The subtitle shown below the title.</p>
pub fn set_sub_title(mut self, input: std::option::Option<std::string::String>) -> Self {
self.sub_title = input;
self
}
/// <p>The URL of an attachment to the response card.</p>
pub fn attachment_link_url(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_link_url = Some(input.into());
self
}
/// <p>The URL of an attachment to the response card.</p>
pub fn set_attachment_link_url(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_link_url = input;
self
}
/// <p>The URL of an image that is displayed to the user.</p>
pub fn image_url(mut self, input: impl Into<std::string::String>) -> Self {
self.image_url = Some(input.into());
self
}
/// <p>The URL of an image that is displayed to the user.</p>
pub fn set_image_url(mut self, input: std::option::Option<std::string::String>) -> Self {
self.image_url = input;
self
}
/// Appends an item to `buttons`.
///
/// To override the contents of this collection use [`set_buttons`](Self::set_buttons).
///
/// <p>The list of options to show to the user.</p>
pub fn buttons(mut self, input: crate::model::Button) -> Self {
let mut v = self.buttons.unwrap_or_default();
v.push(input);
self.buttons = Some(v);
self
}
/// <p>The list of options to show to the user.</p>
pub fn set_buttons(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Button>>,
) -> Self {
self.buttons = input;
self
}
/// Consumes the builder and constructs a [`GenericAttachment`](crate::model::GenericAttachment)
pub fn build(self) -> crate::model::GenericAttachment {
crate::model::GenericAttachment {
title: self.title,
sub_title: self.sub_title,
attachment_link_url: self.attachment_link_url,
image_url: self.image_url,
buttons: self.buttons,
}
}
}
}
impl GenericAttachment {
/// Creates a new builder-style object to manufacture [`GenericAttachment`](crate::model::GenericAttachment)
pub fn builder() -> crate::model::generic_attachment::Builder {
crate::model::generic_attachment::Builder::default()
}
}
/// <p>Represents an option to be shown on the client platform (Facebook, Slack, etc.)</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Button {
/// <p>Text that is visible to the user on the button.</p>
pub text: std::option::Option<std::string::String>,
/// <p>The value sent to Amazon Lex when a user chooses the button. For example, consider button text "NYC." When the user chooses the button, the value sent can be "New York City."</p>
pub value: std::option::Option<std::string::String>,
}
impl Button {
/// <p>Text that is visible to the user on the button.</p>
pub fn text(&self) -> std::option::Option<&str> {
self.text.as_deref()
}
/// <p>The value sent to Amazon Lex when a user chooses the button. For example, consider button text "NYC." When the user chooses the button, the value sent can be "New York City."</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
impl std::fmt::Debug for Button {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Button");
formatter.field("text", &self.text);
formatter.field("value", &self.value);
formatter.finish()
}
}
/// See [`Button`](crate::model::Button)
pub mod button {
/// A builder for [`Button`](crate::model::Button)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) text: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>Text that is visible to the user on the button.</p>
pub fn text(mut self, input: impl Into<std::string::String>) -> Self {
self.text = Some(input.into());
self
}
/// <p>Text that is visible to the user on the button.</p>
pub fn set_text(mut self, input: std::option::Option<std::string::String>) -> Self {
self.text = input;
self
}
/// <p>The value sent to Amazon Lex when a user chooses the button. For example, consider button text "NYC." When the user chooses the button, the value sent can be "New York City."</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The value sent to Amazon Lex when a user chooses the button. For example, consider button text "NYC." When the user chooses the button, the value sent can be "New York City."</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 [`Button`](crate::model::Button)
pub fn build(self) -> crate::model::Button {
crate::model::Button {
text: self.text,
value: self.value,
}
}
}
}
impl Button {
/// Creates a new builder-style object to manufacture [`Button`](crate::model::Button)
pub fn builder() -> crate::model::button::Builder {
crate::model::button::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 ContentType {
#[allow(missing_docs)] // documentation missing in model
Generic,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ContentType {
fn from(s: &str) -> Self {
match s {
"application/vnd.amazonaws.card.generic" => ContentType::Generic,
other => ContentType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ContentType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ContentType::from(s))
}
}
impl ContentType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ContentType::Generic => "application/vnd.amazonaws.card.generic",
ContentType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["application/vnd.amazonaws.card.generic"]
}
}
impl AsRef<str> for ContentType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The sentiment expressed in an utterance.</p>
/// <p>When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field structure contains the result of the analysis.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SentimentResponse {
/// <p>The inferred sentiment that Amazon Comprehend has the highest confidence in.</p>
pub sentiment_label: std::option::Option<std::string::String>,
/// <p>The likelihood that the sentiment was correctly inferred.</p>
pub sentiment_score: std::option::Option<std::string::String>,
}
impl SentimentResponse {
/// <p>The inferred sentiment that Amazon Comprehend has the highest confidence in.</p>
pub fn sentiment_label(&self) -> std::option::Option<&str> {
self.sentiment_label.as_deref()
}
/// <p>The likelihood that the sentiment was correctly inferred.</p>
pub fn sentiment_score(&self) -> std::option::Option<&str> {
self.sentiment_score.as_deref()
}
}
impl std::fmt::Debug for SentimentResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SentimentResponse");
formatter.field("sentiment_label", &self.sentiment_label);
formatter.field("sentiment_score", &self.sentiment_score);
formatter.finish()
}
}
/// See [`SentimentResponse`](crate::model::SentimentResponse)
pub mod sentiment_response {
/// A builder for [`SentimentResponse`](crate::model::SentimentResponse)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) sentiment_label: std::option::Option<std::string::String>,
pub(crate) sentiment_score: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The inferred sentiment that Amazon Comprehend has the highest confidence in.</p>
pub fn sentiment_label(mut self, input: impl Into<std::string::String>) -> Self {
self.sentiment_label = Some(input.into());
self
}
/// <p>The inferred sentiment that Amazon Comprehend has the highest confidence in.</p>
pub fn set_sentiment_label(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sentiment_label = input;
self
}
/// <p>The likelihood that the sentiment was correctly inferred.</p>
pub fn sentiment_score(mut self, input: impl Into<std::string::String>) -> Self {
self.sentiment_score = Some(input.into());
self
}
/// <p>The likelihood that the sentiment was correctly inferred.</p>
pub fn set_sentiment_score(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sentiment_score = input;
self
}
/// Consumes the builder and constructs a [`SentimentResponse`](crate::model::SentimentResponse)
pub fn build(self) -> crate::model::SentimentResponse {
crate::model::SentimentResponse {
sentiment_label: self.sentiment_label,
sentiment_score: self.sentiment_score,
}
}
}
}
impl SentimentResponse {
/// Creates a new builder-style object to manufacture [`SentimentResponse`](crate::model::SentimentResponse)
pub fn builder() -> crate::model::sentiment_response::Builder {
crate::model::sentiment_response::Builder::default()
}
}
/// <p>An intent that Amazon Lex suggests satisfies the user's intent. Includes the name of the intent, the confidence that Amazon Lex has that the user's intent is satisfied, and the slots defined for the intent.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PredictedIntent {
/// <p>The name of the intent that Amazon Lex suggests satisfies the user's intent.</p>
pub intent_name: std::option::Option<std::string::String>,
/// <p>Indicates how confident Amazon Lex is that an intent satisfies the user's intent.</p>
pub nlu_intent_confidence: std::option::Option<crate::model::IntentConfidence>,
/// <p>The slot and slot values associated with the predicted intent.</p>
pub slots:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl PredictedIntent {
/// <p>The name of the intent that Amazon Lex suggests satisfies the user's intent.</p>
pub fn intent_name(&self) -> std::option::Option<&str> {
self.intent_name.as_deref()
}
/// <p>Indicates how confident Amazon Lex is that an intent satisfies the user's intent.</p>
pub fn nlu_intent_confidence(&self) -> std::option::Option<&crate::model::IntentConfidence> {
self.nlu_intent_confidence.as_ref()
}
/// <p>The slot and slot values associated with the predicted intent.</p>
pub fn slots(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.slots.as_ref()
}
}
impl std::fmt::Debug for PredictedIntent {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PredictedIntent");
formatter.field("intent_name", &self.intent_name);
formatter.field("nlu_intent_confidence", &self.nlu_intent_confidence);
formatter.field("slots", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
/// See [`PredictedIntent`](crate::model::PredictedIntent)
pub mod predicted_intent {
/// A builder for [`PredictedIntent`](crate::model::PredictedIntent)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) intent_name: std::option::Option<std::string::String>,
pub(crate) nlu_intent_confidence: std::option::Option<crate::model::IntentConfidence>,
pub(crate) slots: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
/// <p>The name of the intent that Amazon Lex suggests satisfies the user's intent.</p>
pub fn intent_name(mut self, input: impl Into<std::string::String>) -> Self {
self.intent_name = Some(input.into());
self
}
/// <p>The name of the intent that Amazon Lex suggests satisfies the user's intent.</p>
pub fn set_intent_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.intent_name = input;
self
}
/// <p>Indicates how confident Amazon Lex is that an intent satisfies the user's intent.</p>
pub fn nlu_intent_confidence(mut self, input: crate::model::IntentConfidence) -> Self {
self.nlu_intent_confidence = Some(input);
self
}
/// <p>Indicates how confident Amazon Lex is that an intent satisfies the user's intent.</p>
pub fn set_nlu_intent_confidence(
mut self,
input: std::option::Option<crate::model::IntentConfidence>,
) -> Self {
self.nlu_intent_confidence = input;
self
}
/// Adds a key-value pair to `slots`.
///
/// To override the contents of this collection use [`set_slots`](Self::set_slots).
///
/// <p>The slot and slot values associated with the predicted intent.</p>
pub fn slots(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.slots.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.slots = Some(hash_map);
self
}
/// <p>The slot and slot values associated with the predicted intent.</p>
pub fn set_slots(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.slots = input;
self
}
/// Consumes the builder and constructs a [`PredictedIntent`](crate::model::PredictedIntent)
pub fn build(self) -> crate::model::PredictedIntent {
crate::model::PredictedIntent {
intent_name: self.intent_name,
nlu_intent_confidence: self.nlu_intent_confidence,
slots: self.slots,
}
}
}
}
impl PredictedIntent {
/// Creates a new builder-style object to manufacture [`PredictedIntent`](crate::model::PredictedIntent)
pub fn builder() -> crate::model::predicted_intent::Builder {
crate::model::predicted_intent::Builder::default()
}
}
/// <p>Provides a score that indicates the confidence that Amazon Lex has that an intent is the one that satisfies the user's intent.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IntentConfidence {
/// <p>A score that indicates how confident Amazon Lex is that an intent satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher confidence.</p>
pub score: f64,
}
impl IntentConfidence {
/// <p>A score that indicates how confident Amazon Lex is that an intent satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher confidence.</p>
pub fn score(&self) -> f64 {
self.score
}
}
impl std::fmt::Debug for IntentConfidence {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("IntentConfidence");
formatter.field("score", &self.score);
formatter.finish()
}
}
/// See [`IntentConfidence`](crate::model::IntentConfidence)
pub mod intent_confidence {
/// A builder for [`IntentConfidence`](crate::model::IntentConfidence)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) score: std::option::Option<f64>,
}
impl Builder {
/// <p>A score that indicates how confident Amazon Lex is that an intent satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher confidence.</p>
pub fn score(mut self, input: f64) -> Self {
self.score = Some(input);
self
}
/// <p>A score that indicates how confident Amazon Lex is that an intent satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher confidence.</p>
pub fn set_score(mut self, input: std::option::Option<f64>) -> Self {
self.score = input;
self
}
/// Consumes the builder and constructs a [`IntentConfidence`](crate::model::IntentConfidence)
pub fn build(self) -> crate::model::IntentConfidence {
crate::model::IntentConfidence {
score: self.score.unwrap_or_default(),
}
}
}
}
impl IntentConfidence {
/// Creates a new builder-style object to manufacture [`IntentConfidence`](crate::model::IntentConfidence)
pub fn builder() -> crate::model::intent_confidence::Builder {
crate::model::intent_confidence::Builder::default()
}
}