#[allow(missing_docs)] #[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)] ConfirmIntent,
#[allow(missing_docs)] ElicitIntent,
#[allow(missing_docs)] ElicitSlot,
#[allow(missing_docs)] Failed,
#[allow(missing_docs)] Fulfilled,
#[allow(missing_docs)] ReadyForFulfillment,
Unknown(crate::types::UnknownVariantValue),
}
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(crate::types::UnknownVariantValue(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 {
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(value) => value.as_str(),
}
}
pub const 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)] #[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)] Composite,
#[allow(missing_docs)] CustomPayload,
#[allow(missing_docs)] PlainText,
#[allow(missing_docs)] Ssml,
Unknown(crate::types::UnknownVariantValue),
}
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(crate::types::UnknownVariantValue(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 {
pub fn as_str(&self) -> &str {
match self {
MessageFormatType::Composite => "Composite",
MessageFormatType::CustomPayload => "CustomPayload",
MessageFormatType::PlainText => "PlainText",
MessageFormatType::Ssml => "SSML",
MessageFormatType::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["Composite", "CustomPayload", "PlainText", "SSML"]
}
}
impl AsRef<str> for MessageFormatType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ActiveContext {
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub time_to_live: std::option::Option<crate::model::ActiveContextTimeToLive>,
#[doc(hidden)]
pub parameters:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl ActiveContext {
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn time_to_live(&self) -> std::option::Option<&crate::model::ActiveContextTimeToLive> {
self.time_to_live.as_ref()
}
pub fn parameters(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.parameters.as_ref()
}
}
pub mod active_context {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, 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 {
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn time_to_live(mut self, input: crate::model::ActiveContextTimeToLive) -> Self {
self.time_to_live = Some(input);
self
}
pub fn set_time_to_live(
mut self,
input: std::option::Option<crate::model::ActiveContextTimeToLive>,
) -> Self {
self.time_to_live = input;
self
}
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
}
pub fn set_parameters(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.parameters = input;
self
}
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 {
pub fn builder() -> crate::model::active_context::Builder {
crate::model::active_context::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ActiveContextTimeToLive {
#[doc(hidden)]
pub time_to_live_in_seconds: std::option::Option<i32>,
#[doc(hidden)]
pub turns_to_live: std::option::Option<i32>,
}
impl ActiveContextTimeToLive {
pub fn time_to_live_in_seconds(&self) -> std::option::Option<i32> {
self.time_to_live_in_seconds
}
pub fn turns_to_live(&self) -> std::option::Option<i32> {
self.turns_to_live
}
}
pub mod active_context_time_to_live {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, 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 {
pub fn time_to_live_in_seconds(mut self, input: i32) -> Self {
self.time_to_live_in_seconds = Some(input);
self
}
pub fn set_time_to_live_in_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.time_to_live_in_seconds = input;
self
}
pub fn turns_to_live(mut self, input: i32) -> Self {
self.turns_to_live = Some(input);
self
}
pub fn set_turns_to_live(mut self, input: std::option::Option<i32>) -> Self {
self.turns_to_live = input;
self
}
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 {
pub fn builder() -> crate::model::active_context_time_to_live::Builder {
crate::model::active_context_time_to_live::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IntentSummary {
#[doc(hidden)]
pub intent_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub checkpoint_label: std::option::Option<std::string::String>,
#[doc(hidden)]
pub slots:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub confirmation_status: std::option::Option<crate::model::ConfirmationStatus>,
#[doc(hidden)]
pub dialog_action_type: std::option::Option<crate::model::DialogActionType>,
#[doc(hidden)]
pub fulfillment_state: std::option::Option<crate::model::FulfillmentState>,
#[doc(hidden)]
pub slot_to_elicit: std::option::Option<std::string::String>,
}
impl IntentSummary {
pub fn intent_name(&self) -> std::option::Option<&str> {
self.intent_name.as_deref()
}
pub fn checkpoint_label(&self) -> std::option::Option<&str> {
self.checkpoint_label.as_deref()
}
pub fn slots(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.slots.as_ref()
}
pub fn confirmation_status(&self) -> std::option::Option<&crate::model::ConfirmationStatus> {
self.confirmation_status.as_ref()
}
pub fn dialog_action_type(&self) -> std::option::Option<&crate::model::DialogActionType> {
self.dialog_action_type.as_ref()
}
pub fn fulfillment_state(&self) -> std::option::Option<&crate::model::FulfillmentState> {
self.fulfillment_state.as_ref()
}
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()
}
}
pub mod intent_summary {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
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 {
pub fn intent_name(mut self, input: impl Into<std::string::String>) -> Self {
self.intent_name = Some(input.into());
self
}
pub fn set_intent_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.intent_name = input;
self
}
pub fn checkpoint_label(mut self, input: impl Into<std::string::String>) -> Self {
self.checkpoint_label = Some(input.into());
self
}
pub fn set_checkpoint_label(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.checkpoint_label = input;
self
}
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
}
pub fn set_slots(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.slots = input;
self
}
pub fn confirmation_status(mut self, input: crate::model::ConfirmationStatus) -> Self {
self.confirmation_status = Some(input);
self
}
pub fn set_confirmation_status(
mut self,
input: std::option::Option<crate::model::ConfirmationStatus>,
) -> Self {
self.confirmation_status = input;
self
}
pub fn dialog_action_type(mut self, input: crate::model::DialogActionType) -> Self {
self.dialog_action_type = Some(input);
self
}
pub fn set_dialog_action_type(
mut self,
input: std::option::Option<crate::model::DialogActionType>,
) -> Self {
self.dialog_action_type = input;
self
}
pub fn fulfillment_state(mut self, input: crate::model::FulfillmentState) -> Self {
self.fulfillment_state = Some(input);
self
}
pub fn set_fulfillment_state(
mut self,
input: std::option::Option<crate::model::FulfillmentState>,
) -> Self {
self.fulfillment_state = input;
self
}
pub fn slot_to_elicit(mut self, input: impl Into<std::string::String>) -> Self {
self.slot_to_elicit = Some(input.into());
self
}
pub fn set_slot_to_elicit(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.slot_to_elicit = input;
self
}
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 std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
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()
}
}
}
impl IntentSummary {
pub fn builder() -> crate::model::intent_summary::Builder {
crate::model::intent_summary::Builder::default()
}
}
#[allow(missing_docs)] #[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)] Failed,
#[allow(missing_docs)] Fulfilled,
#[allow(missing_docs)] ReadyForFulfillment,
Unknown(crate::types::UnknownVariantValue),
}
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(crate::types::UnknownVariantValue(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 {
pub fn as_str(&self) -> &str {
match self {
FulfillmentState::Failed => "Failed",
FulfillmentState::Fulfilled => "Fulfilled",
FulfillmentState::ReadyForFulfillment => "ReadyForFulfillment",
FulfillmentState::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["Failed", "Fulfilled", "ReadyForFulfillment"]
}
}
impl AsRef<str> for FulfillmentState {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] #[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)] Close,
#[allow(missing_docs)] ConfirmIntent,
#[allow(missing_docs)] Delegate,
#[allow(missing_docs)] ElicitIntent,
#[allow(missing_docs)] ElicitSlot,
Unknown(crate::types::UnknownVariantValue),
}
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(crate::types::UnknownVariantValue(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 {
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(value) => value.as_str(),
}
}
pub const 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)] #[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)] Confirmed,
#[allow(missing_docs)] Denied,
#[allow(missing_docs)] None,
Unknown(crate::types::UnknownVariantValue),
}
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(crate::types::UnknownVariantValue(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 {
pub fn as_str(&self) -> &str {
match self {
ConfirmationStatus::Confirmed => "Confirmed",
ConfirmationStatus::Denied => "Denied",
ConfirmationStatus::None => "None",
ConfirmationStatus::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["Confirmed", "Denied", "None"]
}
}
impl AsRef<str> for ConfirmationStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DialogAction {
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::DialogActionType>,
#[doc(hidden)]
pub intent_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub slots:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub slot_to_elicit: std::option::Option<std::string::String>,
#[doc(hidden)]
pub fulfillment_state: std::option::Option<crate::model::FulfillmentState>,
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_format: std::option::Option<crate::model::MessageFormatType>,
}
impl DialogAction {
pub fn r#type(&self) -> std::option::Option<&crate::model::DialogActionType> {
self.r#type.as_ref()
}
pub fn intent_name(&self) -> std::option::Option<&str> {
self.intent_name.as_deref()
}
pub fn slots(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.slots.as_ref()
}
pub fn slot_to_elicit(&self) -> std::option::Option<&str> {
self.slot_to_elicit.as_deref()
}
pub fn fulfillment_state(&self) -> std::option::Option<&crate::model::FulfillmentState> {
self.fulfillment_state.as_ref()
}
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
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()
}
}
pub mod dialog_action {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
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 {
pub fn r#type(mut self, input: crate::model::DialogActionType) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(
mut self,
input: std::option::Option<crate::model::DialogActionType>,
) -> Self {
self.r#type = input;
self
}
pub fn intent_name(mut self, input: impl Into<std::string::String>) -> Self {
self.intent_name = Some(input.into());
self
}
pub fn set_intent_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.intent_name = input;
self
}
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
}
pub fn set_slots(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.slots = input;
self
}
pub fn slot_to_elicit(mut self, input: impl Into<std::string::String>) -> Self {
self.slot_to_elicit = Some(input.into());
self
}
pub fn set_slot_to_elicit(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.slot_to_elicit = input;
self
}
pub fn fulfillment_state(mut self, input: crate::model::FulfillmentState) -> Self {
self.fulfillment_state = Some(input);
self
}
pub fn set_fulfillment_state(
mut self,
input: std::option::Option<crate::model::FulfillmentState>,
) -> Self {
self.fulfillment_state = input;
self
}
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn message_format(mut self, input: crate::model::MessageFormatType) -> Self {
self.message_format = Some(input);
self
}
pub fn set_message_format(
mut self,
input: std::option::Option<crate::model::MessageFormatType>,
) -> Self {
self.message_format = input;
self
}
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 std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
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()
}
}
}
impl DialogAction {
pub fn builder() -> crate::model::dialog_action::Builder {
crate::model::dialog_action::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ResponseCard {
#[doc(hidden)]
pub version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub content_type: std::option::Option<crate::model::ContentType>,
#[doc(hidden)]
pub generic_attachments: std::option::Option<std::vec::Vec<crate::model::GenericAttachment>>,
}
impl ResponseCard {
pub fn version(&self) -> std::option::Option<&str> {
self.version.as_deref()
}
pub fn content_type(&self) -> std::option::Option<&crate::model::ContentType> {
self.content_type.as_ref()
}
pub fn generic_attachments(&self) -> std::option::Option<&[crate::model::GenericAttachment]> {
self.generic_attachments.as_deref()
}
}
pub mod response_card {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, 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 {
pub fn version(mut self, input: impl Into<std::string::String>) -> Self {
self.version = Some(input.into());
self
}
pub fn set_version(mut self, input: std::option::Option<std::string::String>) -> Self {
self.version = input;
self
}
pub fn content_type(mut self, input: crate::model::ContentType) -> Self {
self.content_type = Some(input);
self
}
pub fn set_content_type(
mut self,
input: std::option::Option<crate::model::ContentType>,
) -> Self {
self.content_type = input;
self
}
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
}
pub fn set_generic_attachments(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::GenericAttachment>>,
) -> Self {
self.generic_attachments = input;
self
}
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 {
pub fn builder() -> crate::model::response_card::Builder {
crate::model::response_card::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GenericAttachment {
#[doc(hidden)]
pub title: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_title: std::option::Option<std::string::String>,
#[doc(hidden)]
pub attachment_link_url: std::option::Option<std::string::String>,
#[doc(hidden)]
pub image_url: std::option::Option<std::string::String>,
#[doc(hidden)]
pub buttons: std::option::Option<std::vec::Vec<crate::model::Button>>,
}
impl GenericAttachment {
pub fn title(&self) -> std::option::Option<&str> {
self.title.as_deref()
}
pub fn sub_title(&self) -> std::option::Option<&str> {
self.sub_title.as_deref()
}
pub fn attachment_link_url(&self) -> std::option::Option<&str> {
self.attachment_link_url.as_deref()
}
pub fn image_url(&self) -> std::option::Option<&str> {
self.image_url.as_deref()
}
pub fn buttons(&self) -> std::option::Option<&[crate::model::Button]> {
self.buttons.as_deref()
}
}
pub mod generic_attachment {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, 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 {
pub fn title(mut self, input: impl Into<std::string::String>) -> Self {
self.title = Some(input.into());
self
}
pub fn set_title(mut self, input: std::option::Option<std::string::String>) -> Self {
self.title = input;
self
}
pub fn sub_title(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_title = Some(input.into());
self
}
pub fn set_sub_title(mut self, input: std::option::Option<std::string::String>) -> Self {
self.sub_title = input;
self
}
pub fn attachment_link_url(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_link_url = Some(input.into());
self
}
pub fn set_attachment_link_url(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_link_url = input;
self
}
pub fn image_url(mut self, input: impl Into<std::string::String>) -> Self {
self.image_url = Some(input.into());
self
}
pub fn set_image_url(mut self, input: std::option::Option<std::string::String>) -> Self {
self.image_url = input;
self
}
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
}
pub fn set_buttons(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Button>>,
) -> Self {
self.buttons = input;
self
}
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 {
pub fn builder() -> crate::model::generic_attachment::Builder {
crate::model::generic_attachment::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Button {
#[doc(hidden)]
pub text: std::option::Option<std::string::String>,
#[doc(hidden)]
pub value: std::option::Option<std::string::String>,
}
impl Button {
pub fn text(&self) -> std::option::Option<&str> {
self.text.as_deref()
}
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
pub mod button {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, 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 {
pub fn text(mut self, input: impl Into<std::string::String>) -> Self {
self.text = Some(input.into());
self
}
pub fn set_text(mut self, input: std::option::Option<std::string::String>) -> Self {
self.text = input;
self
}
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
self.value = input;
self
}
pub fn build(self) -> crate::model::Button {
crate::model::Button {
text: self.text,
value: self.value,
}
}
}
}
impl Button {
pub fn builder() -> crate::model::button::Builder {
crate::model::button::Builder::default()
}
}
#[allow(missing_docs)] #[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)] Generic,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ContentType {
fn from(s: &str) -> Self {
match s {
"application/vnd.amazonaws.card.generic" => ContentType::Generic,
other => ContentType::Unknown(crate::types::UnknownVariantValue(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 {
pub fn as_str(&self) -> &str {
match self {
ContentType::Generic => "application/vnd.amazonaws.card.generic",
ContentType::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["application/vnd.amazonaws.card.generic"]
}
}
impl AsRef<str> for ContentType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SentimentResponse {
#[doc(hidden)]
pub sentiment_label: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sentiment_score: std::option::Option<std::string::String>,
}
impl SentimentResponse {
pub fn sentiment_label(&self) -> std::option::Option<&str> {
self.sentiment_label.as_deref()
}
pub fn sentiment_score(&self) -> std::option::Option<&str> {
self.sentiment_score.as_deref()
}
}
pub mod sentiment_response {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, 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 {
pub fn sentiment_label(mut self, input: impl Into<std::string::String>) -> Self {
self.sentiment_label = Some(input.into());
self
}
pub fn set_sentiment_label(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sentiment_label = input;
self
}
pub fn sentiment_score(mut self, input: impl Into<std::string::String>) -> Self {
self.sentiment_score = Some(input.into());
self
}
pub fn set_sentiment_score(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sentiment_score = input;
self
}
pub fn build(self) -> crate::model::SentimentResponse {
crate::model::SentimentResponse {
sentiment_label: self.sentiment_label,
sentiment_score: self.sentiment_score,
}
}
}
}
impl SentimentResponse {
pub fn builder() -> crate::model::sentiment_response::Builder {
crate::model::sentiment_response::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PredictedIntent {
#[doc(hidden)]
pub intent_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub nlu_intent_confidence: std::option::Option<crate::model::IntentConfidence>,
#[doc(hidden)]
pub slots:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl PredictedIntent {
pub fn intent_name(&self) -> std::option::Option<&str> {
self.intent_name.as_deref()
}
pub fn nlu_intent_confidence(&self) -> std::option::Option<&crate::model::IntentConfidence> {
self.nlu_intent_confidence.as_ref()
}
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()
}
}
pub mod predicted_intent {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
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 {
pub fn intent_name(mut self, input: impl Into<std::string::String>) -> Self {
self.intent_name = Some(input.into());
self
}
pub fn set_intent_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.intent_name = input;
self
}
pub fn nlu_intent_confidence(mut self, input: crate::model::IntentConfidence) -> Self {
self.nlu_intent_confidence = Some(input);
self
}
pub fn set_nlu_intent_confidence(
mut self,
input: std::option::Option<crate::model::IntentConfidence>,
) -> Self {
self.nlu_intent_confidence = input;
self
}
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
}
pub fn set_slots(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.slots = input;
self
}
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 std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("intent_name", &self.intent_name);
formatter.field("nlu_intent_confidence", &self.nlu_intent_confidence);
formatter.field("slots", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
}
impl PredictedIntent {
pub fn builder() -> crate::model::predicted_intent::Builder {
crate::model::predicted_intent::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct IntentConfidence {
#[doc(hidden)]
pub score: f64,
}
impl IntentConfidence {
pub fn score(&self) -> f64 {
self.score
}
}
pub mod intent_confidence {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) score: std::option::Option<f64>,
}
impl Builder {
pub fn score(mut self, input: f64) -> Self {
self.score = Some(input);
self
}
pub fn set_score(mut self, input: std::option::Option<f64>) -> Self {
self.score = input;
self
}
pub fn build(self) -> crate::model::IntentConfidence {
crate::model::IntentConfidence {
score: self.score.unwrap_or_default(),
}
}
}
}
impl IntentConfidence {
pub fn builder() -> crate::model::intent_confidence::Builder {
crate::model::intent_confidence::Builder::default()
}
}