{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.LexV2Models.Types.IntentConfirmationSetting
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.LexV2Models.Types.IntentConfirmationSetting where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types.ConditionalSpecification
import Amazonka.LexV2Models.Types.DialogCodeHookInvocationSetting
import Amazonka.LexV2Models.Types.DialogState
import Amazonka.LexV2Models.Types.ElicitationCodeHookInvocationSetting
import Amazonka.LexV2Models.Types.PromptSpecification
import Amazonka.LexV2Models.Types.ResponseSpecification
import qualified Amazonka.Prelude as Prelude

-- | Provides a prompt for making sure that the user is ready for the intent
-- to be fulfilled.
--
-- /See:/ 'newIntentConfirmationSetting' smart constructor.
data IntentConfirmationSetting = IntentConfirmationSetting'
  { -- | Specifies whether the intent\'s confirmation is sent to the user. When
    -- this field is false, confirmation and declination responses aren\'t
    -- sent. If the @active@ field isn\'t specified, the default is true.
    IntentConfirmationSetting -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
    -- | The @DialogCodeHookInvocationSetting@ object associated with intent\'s
    -- confirmation step. The dialog code hook is triggered based on these
    -- invocation settings when the confirmation next step or declination next
    -- step or failure next step is @InvokeDialogCodeHook@.
    IntentConfirmationSetting -> Maybe DialogCodeHookInvocationSetting
codeHook :: Prelude.Maybe DialogCodeHookInvocationSetting,
    -- | A list of conditional branches to evaluate after the intent is closed.
    IntentConfirmationSetting -> Maybe ConditionalSpecification
confirmationConditional :: Prelude.Maybe ConditionalSpecification,
    -- | Specifies the next step that the bot executes when the customer confirms
    -- the intent.
    IntentConfirmationSetting -> Maybe DialogState
confirmationNextStep :: Prelude.Maybe DialogState,
    IntentConfirmationSetting -> Maybe ResponseSpecification
confirmationResponse :: Prelude.Maybe ResponseSpecification,
    -- | A list of conditional branches to evaluate after the intent is declined.
    IntentConfirmationSetting -> Maybe ConditionalSpecification
declinationConditional :: Prelude.Maybe ConditionalSpecification,
    -- | Specifies the next step that the bot executes when the customer declines
    -- the intent.
    IntentConfirmationSetting -> Maybe DialogState
declinationNextStep :: Prelude.Maybe DialogState,
    -- | When the user answers \"no\" to the question defined in
    -- @promptSpecification@, Amazon Lex responds with this response to
    -- acknowledge that the intent was canceled.
    IntentConfirmationSetting -> Maybe ResponseSpecification
declinationResponse :: Prelude.Maybe ResponseSpecification,
    -- | The @DialogCodeHookInvocationSetting@ used when the code hook is invoked
    -- during confirmation prompt retries.
    IntentConfirmationSetting
-> Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook :: Prelude.Maybe ElicitationCodeHookInvocationSetting,
    IntentConfirmationSetting -> Maybe ConditionalSpecification
failureConditional :: Prelude.Maybe ConditionalSpecification,
    -- | The next step to take in the conversation if the confirmation step
    -- fails.
    IntentConfirmationSetting -> Maybe DialogState
failureNextStep :: Prelude.Maybe DialogState,
    IntentConfirmationSetting -> Maybe ResponseSpecification
failureResponse :: Prelude.Maybe ResponseSpecification,
    -- | Prompts the user to confirm the intent. This question should have a yes
    -- or no answer.
    --
    -- Amazon Lex uses this prompt to ensure that the user acknowledges that
    -- the intent is ready for fulfillment. For example, with the @OrderPizza@
    -- intent, you might want to confirm that the order is correct before
    -- placing it. For other intents, such as intents that simply respond to
    -- user questions, you might not need to ask the user for confirmation
    -- before providing the information.
    IntentConfirmationSetting -> PromptSpecification
promptSpecification :: PromptSpecification
  }
  deriving (IntentConfirmationSetting -> IntentConfirmationSetting -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IntentConfirmationSetting -> IntentConfirmationSetting -> Bool
$c/= :: IntentConfirmationSetting -> IntentConfirmationSetting -> Bool
== :: IntentConfirmationSetting -> IntentConfirmationSetting -> Bool
$c== :: IntentConfirmationSetting -> IntentConfirmationSetting -> Bool
Prelude.Eq, ReadPrec [IntentConfirmationSetting]
ReadPrec IntentConfirmationSetting
Int -> ReadS IntentConfirmationSetting
ReadS [IntentConfirmationSetting]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IntentConfirmationSetting]
$creadListPrec :: ReadPrec [IntentConfirmationSetting]
readPrec :: ReadPrec IntentConfirmationSetting
$creadPrec :: ReadPrec IntentConfirmationSetting
readList :: ReadS [IntentConfirmationSetting]
$creadList :: ReadS [IntentConfirmationSetting]
readsPrec :: Int -> ReadS IntentConfirmationSetting
$creadsPrec :: Int -> ReadS IntentConfirmationSetting
Prelude.Read, Int -> IntentConfirmationSetting -> ShowS
[IntentConfirmationSetting] -> ShowS
IntentConfirmationSetting -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IntentConfirmationSetting] -> ShowS
$cshowList :: [IntentConfirmationSetting] -> ShowS
show :: IntentConfirmationSetting -> String
$cshow :: IntentConfirmationSetting -> String
showsPrec :: Int -> IntentConfirmationSetting -> ShowS
$cshowsPrec :: Int -> IntentConfirmationSetting -> ShowS
Prelude.Show, forall x.
Rep IntentConfirmationSetting x -> IntentConfirmationSetting
forall x.
IntentConfirmationSetting -> Rep IntentConfirmationSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep IntentConfirmationSetting x -> IntentConfirmationSetting
$cfrom :: forall x.
IntentConfirmationSetting -> Rep IntentConfirmationSetting x
Prelude.Generic)

-- |
-- Create a value of 'IntentConfirmationSetting' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'active', 'intentConfirmationSetting_active' - Specifies whether the intent\'s confirmation is sent to the user. When
-- this field is false, confirmation and declination responses aren\'t
-- sent. If the @active@ field isn\'t specified, the default is true.
--
-- 'codeHook', 'intentConfirmationSetting_codeHook' - The @DialogCodeHookInvocationSetting@ object associated with intent\'s
-- confirmation step. The dialog code hook is triggered based on these
-- invocation settings when the confirmation next step or declination next
-- step or failure next step is @InvokeDialogCodeHook@.
--
-- 'confirmationConditional', 'intentConfirmationSetting_confirmationConditional' - A list of conditional branches to evaluate after the intent is closed.
--
-- 'confirmationNextStep', 'intentConfirmationSetting_confirmationNextStep' - Specifies the next step that the bot executes when the customer confirms
-- the intent.
--
-- 'confirmationResponse', 'intentConfirmationSetting_confirmationResponse' - Undocumented member.
--
-- 'declinationConditional', 'intentConfirmationSetting_declinationConditional' - A list of conditional branches to evaluate after the intent is declined.
--
-- 'declinationNextStep', 'intentConfirmationSetting_declinationNextStep' - Specifies the next step that the bot executes when the customer declines
-- the intent.
--
-- 'declinationResponse', 'intentConfirmationSetting_declinationResponse' - When the user answers \"no\" to the question defined in
-- @promptSpecification@, Amazon Lex responds with this response to
-- acknowledge that the intent was canceled.
--
-- 'elicitationCodeHook', 'intentConfirmationSetting_elicitationCodeHook' - The @DialogCodeHookInvocationSetting@ used when the code hook is invoked
-- during confirmation prompt retries.
--
-- 'failureConditional', 'intentConfirmationSetting_failureConditional' - Undocumented member.
--
-- 'failureNextStep', 'intentConfirmationSetting_failureNextStep' - The next step to take in the conversation if the confirmation step
-- fails.
--
-- 'failureResponse', 'intentConfirmationSetting_failureResponse' - Undocumented member.
--
-- 'promptSpecification', 'intentConfirmationSetting_promptSpecification' - Prompts the user to confirm the intent. This question should have a yes
-- or no answer.
--
-- Amazon Lex uses this prompt to ensure that the user acknowledges that
-- the intent is ready for fulfillment. For example, with the @OrderPizza@
-- intent, you might want to confirm that the order is correct before
-- placing it. For other intents, such as intents that simply respond to
-- user questions, you might not need to ask the user for confirmation
-- before providing the information.
newIntentConfirmationSetting ::
  -- | 'promptSpecification'
  PromptSpecification ->
  IntentConfirmationSetting
newIntentConfirmationSetting :: PromptSpecification -> IntentConfirmationSetting
newIntentConfirmationSetting PromptSpecification
pPromptSpecification_ =
  IntentConfirmationSetting'
    { $sel:active:IntentConfirmationSetting' :: Maybe Bool
active =
        forall a. Maybe a
Prelude.Nothing,
      $sel:codeHook:IntentConfirmationSetting' :: Maybe DialogCodeHookInvocationSetting
codeHook = forall a. Maybe a
Prelude.Nothing,
      $sel:confirmationConditional:IntentConfirmationSetting' :: Maybe ConditionalSpecification
confirmationConditional = forall a. Maybe a
Prelude.Nothing,
      $sel:confirmationNextStep:IntentConfirmationSetting' :: Maybe DialogState
confirmationNextStep = forall a. Maybe a
Prelude.Nothing,
      $sel:confirmationResponse:IntentConfirmationSetting' :: Maybe ResponseSpecification
confirmationResponse = forall a. Maybe a
Prelude.Nothing,
      $sel:declinationConditional:IntentConfirmationSetting' :: Maybe ConditionalSpecification
declinationConditional = forall a. Maybe a
Prelude.Nothing,
      $sel:declinationNextStep:IntentConfirmationSetting' :: Maybe DialogState
declinationNextStep = forall a. Maybe a
Prelude.Nothing,
      $sel:declinationResponse:IntentConfirmationSetting' :: Maybe ResponseSpecification
declinationResponse = forall a. Maybe a
Prelude.Nothing,
      $sel:elicitationCodeHook:IntentConfirmationSetting' :: Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook = forall a. Maybe a
Prelude.Nothing,
      $sel:failureConditional:IntentConfirmationSetting' :: Maybe ConditionalSpecification
failureConditional = forall a. Maybe a
Prelude.Nothing,
      $sel:failureNextStep:IntentConfirmationSetting' :: Maybe DialogState
failureNextStep = forall a. Maybe a
Prelude.Nothing,
      $sel:failureResponse:IntentConfirmationSetting' :: Maybe ResponseSpecification
failureResponse = forall a. Maybe a
Prelude.Nothing,
      $sel:promptSpecification:IntentConfirmationSetting' :: PromptSpecification
promptSpecification = PromptSpecification
pPromptSpecification_
    }

-- | Specifies whether the intent\'s confirmation is sent to the user. When
-- this field is false, confirmation and declination responses aren\'t
-- sent. If the @active@ field isn\'t specified, the default is true.
intentConfirmationSetting_active :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe Prelude.Bool)
intentConfirmationSetting_active :: Lens' IntentConfirmationSetting (Maybe Bool)
intentConfirmationSetting_active = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe Bool
active :: Maybe Bool
$sel:active:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe Bool
active} -> Maybe Bool
active) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe Bool
a -> IntentConfirmationSetting
s {$sel:active:IntentConfirmationSetting' :: Maybe Bool
active = Maybe Bool
a} :: IntentConfirmationSetting)

-- | The @DialogCodeHookInvocationSetting@ object associated with intent\'s
-- confirmation step. The dialog code hook is triggered based on these
-- invocation settings when the confirmation next step or declination next
-- step or failure next step is @InvokeDialogCodeHook@.
intentConfirmationSetting_codeHook :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe DialogCodeHookInvocationSetting)
intentConfirmationSetting_codeHook :: Lens'
  IntentConfirmationSetting (Maybe DialogCodeHookInvocationSetting)
intentConfirmationSetting_codeHook = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe DialogCodeHookInvocationSetting
codeHook :: Maybe DialogCodeHookInvocationSetting
$sel:codeHook:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogCodeHookInvocationSetting
codeHook} -> Maybe DialogCodeHookInvocationSetting
codeHook) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe DialogCodeHookInvocationSetting
a -> IntentConfirmationSetting
s {$sel:codeHook:IntentConfirmationSetting' :: Maybe DialogCodeHookInvocationSetting
codeHook = Maybe DialogCodeHookInvocationSetting
a} :: IntentConfirmationSetting)

-- | A list of conditional branches to evaluate after the intent is closed.
intentConfirmationSetting_confirmationConditional :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe ConditionalSpecification)
intentConfirmationSetting_confirmationConditional :: Lens' IntentConfirmationSetting (Maybe ConditionalSpecification)
intentConfirmationSetting_confirmationConditional = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe ConditionalSpecification
confirmationConditional :: Maybe ConditionalSpecification
$sel:confirmationConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
confirmationConditional} -> Maybe ConditionalSpecification
confirmationConditional) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe ConditionalSpecification
a -> IntentConfirmationSetting
s {$sel:confirmationConditional:IntentConfirmationSetting' :: Maybe ConditionalSpecification
confirmationConditional = Maybe ConditionalSpecification
a} :: IntentConfirmationSetting)

-- | Specifies the next step that the bot executes when the customer confirms
-- the intent.
intentConfirmationSetting_confirmationNextStep :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe DialogState)
intentConfirmationSetting_confirmationNextStep :: Lens' IntentConfirmationSetting (Maybe DialogState)
intentConfirmationSetting_confirmationNextStep = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe DialogState
confirmationNextStep :: Maybe DialogState
$sel:confirmationNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
confirmationNextStep} -> Maybe DialogState
confirmationNextStep) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe DialogState
a -> IntentConfirmationSetting
s {$sel:confirmationNextStep:IntentConfirmationSetting' :: Maybe DialogState
confirmationNextStep = Maybe DialogState
a} :: IntentConfirmationSetting)

-- | Undocumented member.
intentConfirmationSetting_confirmationResponse :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe ResponseSpecification)
intentConfirmationSetting_confirmationResponse :: Lens' IntentConfirmationSetting (Maybe ResponseSpecification)
intentConfirmationSetting_confirmationResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe ResponseSpecification
confirmationResponse :: Maybe ResponseSpecification
$sel:confirmationResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
confirmationResponse} -> Maybe ResponseSpecification
confirmationResponse) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe ResponseSpecification
a -> IntentConfirmationSetting
s {$sel:confirmationResponse:IntentConfirmationSetting' :: Maybe ResponseSpecification
confirmationResponse = Maybe ResponseSpecification
a} :: IntentConfirmationSetting)

-- | A list of conditional branches to evaluate after the intent is declined.
intentConfirmationSetting_declinationConditional :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe ConditionalSpecification)
intentConfirmationSetting_declinationConditional :: Lens' IntentConfirmationSetting (Maybe ConditionalSpecification)
intentConfirmationSetting_declinationConditional = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe ConditionalSpecification
declinationConditional :: Maybe ConditionalSpecification
$sel:declinationConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
declinationConditional} -> Maybe ConditionalSpecification
declinationConditional) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe ConditionalSpecification
a -> IntentConfirmationSetting
s {$sel:declinationConditional:IntentConfirmationSetting' :: Maybe ConditionalSpecification
declinationConditional = Maybe ConditionalSpecification
a} :: IntentConfirmationSetting)

-- | Specifies the next step that the bot executes when the customer declines
-- the intent.
intentConfirmationSetting_declinationNextStep :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe DialogState)
intentConfirmationSetting_declinationNextStep :: Lens' IntentConfirmationSetting (Maybe DialogState)
intentConfirmationSetting_declinationNextStep = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe DialogState
declinationNextStep :: Maybe DialogState
$sel:declinationNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
declinationNextStep} -> Maybe DialogState
declinationNextStep) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe DialogState
a -> IntentConfirmationSetting
s {$sel:declinationNextStep:IntentConfirmationSetting' :: Maybe DialogState
declinationNextStep = Maybe DialogState
a} :: IntentConfirmationSetting)

-- | When the user answers \"no\" to the question defined in
-- @promptSpecification@, Amazon Lex responds with this response to
-- acknowledge that the intent was canceled.
intentConfirmationSetting_declinationResponse :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe ResponseSpecification)
intentConfirmationSetting_declinationResponse :: Lens' IntentConfirmationSetting (Maybe ResponseSpecification)
intentConfirmationSetting_declinationResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe ResponseSpecification
declinationResponse :: Maybe ResponseSpecification
$sel:declinationResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
declinationResponse} -> Maybe ResponseSpecification
declinationResponse) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe ResponseSpecification
a -> IntentConfirmationSetting
s {$sel:declinationResponse:IntentConfirmationSetting' :: Maybe ResponseSpecification
declinationResponse = Maybe ResponseSpecification
a} :: IntentConfirmationSetting)

-- | The @DialogCodeHookInvocationSetting@ used when the code hook is invoked
-- during confirmation prompt retries.
intentConfirmationSetting_elicitationCodeHook :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe ElicitationCodeHookInvocationSetting)
intentConfirmationSetting_elicitationCodeHook :: Lens'
  IntentConfirmationSetting
  (Maybe ElicitationCodeHookInvocationSetting)
intentConfirmationSetting_elicitationCodeHook = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook :: Maybe ElicitationCodeHookInvocationSetting
$sel:elicitationCodeHook:IntentConfirmationSetting' :: IntentConfirmationSetting
-> Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook} -> Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe ElicitationCodeHookInvocationSetting
a -> IntentConfirmationSetting
s {$sel:elicitationCodeHook:IntentConfirmationSetting' :: Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook = Maybe ElicitationCodeHookInvocationSetting
a} :: IntentConfirmationSetting)

-- | Undocumented member.
intentConfirmationSetting_failureConditional :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe ConditionalSpecification)
intentConfirmationSetting_failureConditional :: Lens' IntentConfirmationSetting (Maybe ConditionalSpecification)
intentConfirmationSetting_failureConditional = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe ConditionalSpecification
failureConditional :: Maybe ConditionalSpecification
$sel:failureConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
failureConditional} -> Maybe ConditionalSpecification
failureConditional) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe ConditionalSpecification
a -> IntentConfirmationSetting
s {$sel:failureConditional:IntentConfirmationSetting' :: Maybe ConditionalSpecification
failureConditional = Maybe ConditionalSpecification
a} :: IntentConfirmationSetting)

-- | The next step to take in the conversation if the confirmation step
-- fails.
intentConfirmationSetting_failureNextStep :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe DialogState)
intentConfirmationSetting_failureNextStep :: Lens' IntentConfirmationSetting (Maybe DialogState)
intentConfirmationSetting_failureNextStep = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe DialogState
failureNextStep :: Maybe DialogState
$sel:failureNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
failureNextStep} -> Maybe DialogState
failureNextStep) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe DialogState
a -> IntentConfirmationSetting
s {$sel:failureNextStep:IntentConfirmationSetting' :: Maybe DialogState
failureNextStep = Maybe DialogState
a} :: IntentConfirmationSetting)

-- | Undocumented member.
intentConfirmationSetting_failureResponse :: Lens.Lens' IntentConfirmationSetting (Prelude.Maybe ResponseSpecification)
intentConfirmationSetting_failureResponse :: Lens' IntentConfirmationSetting (Maybe ResponseSpecification)
intentConfirmationSetting_failureResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {Maybe ResponseSpecification
failureResponse :: Maybe ResponseSpecification
$sel:failureResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
failureResponse} -> Maybe ResponseSpecification
failureResponse) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} Maybe ResponseSpecification
a -> IntentConfirmationSetting
s {$sel:failureResponse:IntentConfirmationSetting' :: Maybe ResponseSpecification
failureResponse = Maybe ResponseSpecification
a} :: IntentConfirmationSetting)

-- | Prompts the user to confirm the intent. This question should have a yes
-- or no answer.
--
-- Amazon Lex uses this prompt to ensure that the user acknowledges that
-- the intent is ready for fulfillment. For example, with the @OrderPizza@
-- intent, you might want to confirm that the order is correct before
-- placing it. For other intents, such as intents that simply respond to
-- user questions, you might not need to ask the user for confirmation
-- before providing the information.
intentConfirmationSetting_promptSpecification :: Lens.Lens' IntentConfirmationSetting PromptSpecification
intentConfirmationSetting_promptSpecification :: Lens' IntentConfirmationSetting PromptSpecification
intentConfirmationSetting_promptSpecification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentConfirmationSetting' {PromptSpecification
promptSpecification :: PromptSpecification
$sel:promptSpecification:IntentConfirmationSetting' :: IntentConfirmationSetting -> PromptSpecification
promptSpecification} -> PromptSpecification
promptSpecification) (\s :: IntentConfirmationSetting
s@IntentConfirmationSetting' {} PromptSpecification
a -> IntentConfirmationSetting
s {$sel:promptSpecification:IntentConfirmationSetting' :: PromptSpecification
promptSpecification = PromptSpecification
a} :: IntentConfirmationSetting)

instance Data.FromJSON IntentConfirmationSetting where
  parseJSON :: Value -> Parser IntentConfirmationSetting
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"IntentConfirmationSetting"
      ( \Object
x ->
          Maybe Bool
-> Maybe DialogCodeHookInvocationSetting
-> Maybe ConditionalSpecification
-> Maybe DialogState
-> Maybe ResponseSpecification
-> Maybe ConditionalSpecification
-> Maybe DialogState
-> Maybe ResponseSpecification
-> Maybe ElicitationCodeHookInvocationSetting
-> Maybe ConditionalSpecification
-> Maybe DialogState
-> Maybe ResponseSpecification
-> PromptSpecification
-> IntentConfirmationSetting
IntentConfirmationSetting'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"active")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"codeHook")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"confirmationConditional")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"confirmationNextStep")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"confirmationResponse")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"declinationConditional")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"declinationNextStep")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"declinationResponse")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"elicitationCodeHook")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"failureConditional")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"failureNextStep")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"failureResponse")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"promptSpecification")
      )

instance Prelude.Hashable IntentConfirmationSetting where
  hashWithSalt :: Int -> IntentConfirmationSetting -> Int
hashWithSalt Int
_salt IntentConfirmationSetting' {Maybe Bool
Maybe ElicitationCodeHookInvocationSetting
Maybe ResponseSpecification
Maybe DialogState
Maybe ConditionalSpecification
Maybe DialogCodeHookInvocationSetting
PromptSpecification
promptSpecification :: PromptSpecification
failureResponse :: Maybe ResponseSpecification
failureNextStep :: Maybe DialogState
failureConditional :: Maybe ConditionalSpecification
elicitationCodeHook :: Maybe ElicitationCodeHookInvocationSetting
declinationResponse :: Maybe ResponseSpecification
declinationNextStep :: Maybe DialogState
declinationConditional :: Maybe ConditionalSpecification
confirmationResponse :: Maybe ResponseSpecification
confirmationNextStep :: Maybe DialogState
confirmationConditional :: Maybe ConditionalSpecification
codeHook :: Maybe DialogCodeHookInvocationSetting
active :: Maybe Bool
$sel:promptSpecification:IntentConfirmationSetting' :: IntentConfirmationSetting -> PromptSpecification
$sel:failureResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
$sel:failureNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
$sel:failureConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
$sel:elicitationCodeHook:IntentConfirmationSetting' :: IntentConfirmationSetting
-> Maybe ElicitationCodeHookInvocationSetting
$sel:declinationResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
$sel:declinationNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
$sel:declinationConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
$sel:confirmationResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
$sel:confirmationNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
$sel:confirmationConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
$sel:codeHook:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogCodeHookInvocationSetting
$sel:active:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
active
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DialogCodeHookInvocationSetting
codeHook
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConditionalSpecification
confirmationConditional
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DialogState
confirmationNextStep
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResponseSpecification
confirmationResponse
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConditionalSpecification
declinationConditional
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DialogState
declinationNextStep
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResponseSpecification
declinationResponse
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConditionalSpecification
failureConditional
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DialogState
failureNextStep
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResponseSpecification
failureResponse
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PromptSpecification
promptSpecification

instance Prelude.NFData IntentConfirmationSetting where
  rnf :: IntentConfirmationSetting -> ()
rnf IntentConfirmationSetting' {Maybe Bool
Maybe ElicitationCodeHookInvocationSetting
Maybe ResponseSpecification
Maybe DialogState
Maybe ConditionalSpecification
Maybe DialogCodeHookInvocationSetting
PromptSpecification
promptSpecification :: PromptSpecification
failureResponse :: Maybe ResponseSpecification
failureNextStep :: Maybe DialogState
failureConditional :: Maybe ConditionalSpecification
elicitationCodeHook :: Maybe ElicitationCodeHookInvocationSetting
declinationResponse :: Maybe ResponseSpecification
declinationNextStep :: Maybe DialogState
declinationConditional :: Maybe ConditionalSpecification
confirmationResponse :: Maybe ResponseSpecification
confirmationNextStep :: Maybe DialogState
confirmationConditional :: Maybe ConditionalSpecification
codeHook :: Maybe DialogCodeHookInvocationSetting
active :: Maybe Bool
$sel:promptSpecification:IntentConfirmationSetting' :: IntentConfirmationSetting -> PromptSpecification
$sel:failureResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
$sel:failureNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
$sel:failureConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
$sel:elicitationCodeHook:IntentConfirmationSetting' :: IntentConfirmationSetting
-> Maybe ElicitationCodeHookInvocationSetting
$sel:declinationResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
$sel:declinationNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
$sel:declinationConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
$sel:confirmationResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
$sel:confirmationNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
$sel:confirmationConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
$sel:codeHook:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogCodeHookInvocationSetting
$sel:active:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
active
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DialogCodeHookInvocationSetting
codeHook
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConditionalSpecification
confirmationConditional
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DialogState
confirmationNextStep
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResponseSpecification
confirmationResponse
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConditionalSpecification
declinationConditional
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DialogState
declinationNextStep
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResponseSpecification
declinationResponse
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConditionalSpecification
failureConditional
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DialogState
failureNextStep
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResponseSpecification
failureResponse
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PromptSpecification
promptSpecification

instance Data.ToJSON IntentConfirmationSetting where
  toJSON :: IntentConfirmationSetting -> Value
toJSON IntentConfirmationSetting' {Maybe Bool
Maybe ElicitationCodeHookInvocationSetting
Maybe ResponseSpecification
Maybe DialogState
Maybe ConditionalSpecification
Maybe DialogCodeHookInvocationSetting
PromptSpecification
promptSpecification :: PromptSpecification
failureResponse :: Maybe ResponseSpecification
failureNextStep :: Maybe DialogState
failureConditional :: Maybe ConditionalSpecification
elicitationCodeHook :: Maybe ElicitationCodeHookInvocationSetting
declinationResponse :: Maybe ResponseSpecification
declinationNextStep :: Maybe DialogState
declinationConditional :: Maybe ConditionalSpecification
confirmationResponse :: Maybe ResponseSpecification
confirmationNextStep :: Maybe DialogState
confirmationConditional :: Maybe ConditionalSpecification
codeHook :: Maybe DialogCodeHookInvocationSetting
active :: Maybe Bool
$sel:promptSpecification:IntentConfirmationSetting' :: IntentConfirmationSetting -> PromptSpecification
$sel:failureResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
$sel:failureNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
$sel:failureConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
$sel:elicitationCodeHook:IntentConfirmationSetting' :: IntentConfirmationSetting
-> Maybe ElicitationCodeHookInvocationSetting
$sel:declinationResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
$sel:declinationNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
$sel:declinationConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
$sel:confirmationResponse:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ResponseSpecification
$sel:confirmationNextStep:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogState
$sel:confirmationConditional:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe ConditionalSpecification
$sel:codeHook:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe DialogCodeHookInvocationSetting
$sel:active:IntentConfirmationSetting' :: IntentConfirmationSetting -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"active" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
active,
            (Key
"codeHook" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DialogCodeHookInvocationSetting
codeHook,
            (Key
"confirmationConditional" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConditionalSpecification
confirmationConditional,
            (Key
"confirmationNextStep" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DialogState
confirmationNextStep,
            (Key
"confirmationResponse" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResponseSpecification
confirmationResponse,
            (Key
"declinationConditional" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConditionalSpecification
declinationConditional,
            (Key
"declinationNextStep" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DialogState
declinationNextStep,
            (Key
"declinationResponse" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResponseSpecification
declinationResponse,
            (Key
"elicitationCodeHook" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook,
            (Key
"failureConditional" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConditionalSpecification
failureConditional,
            (Key
"failureNextStep" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DialogState
failureNextStep,
            (Key
"failureResponse" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResponseSpecification
failureResponse,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"promptSpecification" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= PromptSpecification
promptSpecification)
          ]
      )