{-# 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.SlotCaptureSetting
-- 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.SlotCaptureSetting 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.ResponseSpecification
import qualified Amazonka.Prelude as Prelude

-- | Settings used when Amazon Lex successfully captures a slot value from a
-- user.
--
-- /See:/ 'newSlotCaptureSetting' smart constructor.
data SlotCaptureSetting = SlotCaptureSetting'
  { -- | A list of conditional branches to evaluate after the slot value is
    -- captured.
    SlotCaptureSetting -> Maybe ConditionalSpecification
captureConditional :: Prelude.Maybe ConditionalSpecification,
    -- | Specifies the next step that the bot runs when the slot value is
    -- captured before the code hook times out.
    SlotCaptureSetting -> Maybe DialogState
captureNextStep :: Prelude.Maybe DialogState,
    SlotCaptureSetting -> Maybe ResponseSpecification
captureResponse :: Prelude.Maybe ResponseSpecification,
    -- | Code hook called after Amazon Lex successfully captures a slot value.
    SlotCaptureSetting -> Maybe DialogCodeHookInvocationSetting
codeHook :: Prelude.Maybe DialogCodeHookInvocationSetting,
    -- | Code hook called when Amazon Lex doesn\'t capture a slot value.
    SlotCaptureSetting -> Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook :: Prelude.Maybe ElicitationCodeHookInvocationSetting,
    -- | A list of conditional branches to evaluate when the slot value isn\'t
    -- captured.
    SlotCaptureSetting -> Maybe ConditionalSpecification
failureConditional :: Prelude.Maybe ConditionalSpecification,
    -- | Specifies the next step that the bot runs when the slot value code is
    -- not recognized.
    SlotCaptureSetting -> Maybe DialogState
failureNextStep :: Prelude.Maybe DialogState,
    SlotCaptureSetting -> Maybe ResponseSpecification
failureResponse :: Prelude.Maybe ResponseSpecification
  }
  deriving (SlotCaptureSetting -> SlotCaptureSetting -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SlotCaptureSetting -> SlotCaptureSetting -> Bool
$c/= :: SlotCaptureSetting -> SlotCaptureSetting -> Bool
== :: SlotCaptureSetting -> SlotCaptureSetting -> Bool
$c== :: SlotCaptureSetting -> SlotCaptureSetting -> Bool
Prelude.Eq, ReadPrec [SlotCaptureSetting]
ReadPrec SlotCaptureSetting
Int -> ReadS SlotCaptureSetting
ReadS [SlotCaptureSetting]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SlotCaptureSetting]
$creadListPrec :: ReadPrec [SlotCaptureSetting]
readPrec :: ReadPrec SlotCaptureSetting
$creadPrec :: ReadPrec SlotCaptureSetting
readList :: ReadS [SlotCaptureSetting]
$creadList :: ReadS [SlotCaptureSetting]
readsPrec :: Int -> ReadS SlotCaptureSetting
$creadsPrec :: Int -> ReadS SlotCaptureSetting
Prelude.Read, Int -> SlotCaptureSetting -> ShowS
[SlotCaptureSetting] -> ShowS
SlotCaptureSetting -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SlotCaptureSetting] -> ShowS
$cshowList :: [SlotCaptureSetting] -> ShowS
show :: SlotCaptureSetting -> String
$cshow :: SlotCaptureSetting -> String
showsPrec :: Int -> SlotCaptureSetting -> ShowS
$cshowsPrec :: Int -> SlotCaptureSetting -> ShowS
Prelude.Show, forall x. Rep SlotCaptureSetting x -> SlotCaptureSetting
forall x. SlotCaptureSetting -> Rep SlotCaptureSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SlotCaptureSetting x -> SlotCaptureSetting
$cfrom :: forall x. SlotCaptureSetting -> Rep SlotCaptureSetting x
Prelude.Generic)

-- |
-- Create a value of 'SlotCaptureSetting' 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:
--
-- 'captureConditional', 'slotCaptureSetting_captureConditional' - A list of conditional branches to evaluate after the slot value is
-- captured.
--
-- 'captureNextStep', 'slotCaptureSetting_captureNextStep' - Specifies the next step that the bot runs when the slot value is
-- captured before the code hook times out.
--
-- 'captureResponse', 'slotCaptureSetting_captureResponse' - Undocumented member.
--
-- 'codeHook', 'slotCaptureSetting_codeHook' - Code hook called after Amazon Lex successfully captures a slot value.
--
-- 'elicitationCodeHook', 'slotCaptureSetting_elicitationCodeHook' - Code hook called when Amazon Lex doesn\'t capture a slot value.
--
-- 'failureConditional', 'slotCaptureSetting_failureConditional' - A list of conditional branches to evaluate when the slot value isn\'t
-- captured.
--
-- 'failureNextStep', 'slotCaptureSetting_failureNextStep' - Specifies the next step that the bot runs when the slot value code is
-- not recognized.
--
-- 'failureResponse', 'slotCaptureSetting_failureResponse' - Undocumented member.
newSlotCaptureSetting ::
  SlotCaptureSetting
newSlotCaptureSetting :: SlotCaptureSetting
newSlotCaptureSetting =
  SlotCaptureSetting'
    { $sel:captureConditional:SlotCaptureSetting' :: Maybe ConditionalSpecification
captureConditional =
        forall a. Maybe a
Prelude.Nothing,
      $sel:captureNextStep:SlotCaptureSetting' :: Maybe DialogState
captureNextStep = forall a. Maybe a
Prelude.Nothing,
      $sel:captureResponse:SlotCaptureSetting' :: Maybe ResponseSpecification
captureResponse = forall a. Maybe a
Prelude.Nothing,
      $sel:codeHook:SlotCaptureSetting' :: Maybe DialogCodeHookInvocationSetting
codeHook = forall a. Maybe a
Prelude.Nothing,
      $sel:elicitationCodeHook:SlotCaptureSetting' :: Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook = forall a. Maybe a
Prelude.Nothing,
      $sel:failureConditional:SlotCaptureSetting' :: Maybe ConditionalSpecification
failureConditional = forall a. Maybe a
Prelude.Nothing,
      $sel:failureNextStep:SlotCaptureSetting' :: Maybe DialogState
failureNextStep = forall a. Maybe a
Prelude.Nothing,
      $sel:failureResponse:SlotCaptureSetting' :: Maybe ResponseSpecification
failureResponse = forall a. Maybe a
Prelude.Nothing
    }

-- | A list of conditional branches to evaluate after the slot value is
-- captured.
slotCaptureSetting_captureConditional :: Lens.Lens' SlotCaptureSetting (Prelude.Maybe ConditionalSpecification)
slotCaptureSetting_captureConditional :: Lens' SlotCaptureSetting (Maybe ConditionalSpecification)
slotCaptureSetting_captureConditional = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotCaptureSetting' {Maybe ConditionalSpecification
captureConditional :: Maybe ConditionalSpecification
$sel:captureConditional:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ConditionalSpecification
captureConditional} -> Maybe ConditionalSpecification
captureConditional) (\s :: SlotCaptureSetting
s@SlotCaptureSetting' {} Maybe ConditionalSpecification
a -> SlotCaptureSetting
s {$sel:captureConditional:SlotCaptureSetting' :: Maybe ConditionalSpecification
captureConditional = Maybe ConditionalSpecification
a} :: SlotCaptureSetting)

-- | Specifies the next step that the bot runs when the slot value is
-- captured before the code hook times out.
slotCaptureSetting_captureNextStep :: Lens.Lens' SlotCaptureSetting (Prelude.Maybe DialogState)
slotCaptureSetting_captureNextStep :: Lens' SlotCaptureSetting (Maybe DialogState)
slotCaptureSetting_captureNextStep = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotCaptureSetting' {Maybe DialogState
captureNextStep :: Maybe DialogState
$sel:captureNextStep:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogState
captureNextStep} -> Maybe DialogState
captureNextStep) (\s :: SlotCaptureSetting
s@SlotCaptureSetting' {} Maybe DialogState
a -> SlotCaptureSetting
s {$sel:captureNextStep:SlotCaptureSetting' :: Maybe DialogState
captureNextStep = Maybe DialogState
a} :: SlotCaptureSetting)

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

-- | Code hook called after Amazon Lex successfully captures a slot value.
slotCaptureSetting_codeHook :: Lens.Lens' SlotCaptureSetting (Prelude.Maybe DialogCodeHookInvocationSetting)
slotCaptureSetting_codeHook :: Lens' SlotCaptureSetting (Maybe DialogCodeHookInvocationSetting)
slotCaptureSetting_codeHook = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotCaptureSetting' {Maybe DialogCodeHookInvocationSetting
codeHook :: Maybe DialogCodeHookInvocationSetting
$sel:codeHook:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogCodeHookInvocationSetting
codeHook} -> Maybe DialogCodeHookInvocationSetting
codeHook) (\s :: SlotCaptureSetting
s@SlotCaptureSetting' {} Maybe DialogCodeHookInvocationSetting
a -> SlotCaptureSetting
s {$sel:codeHook:SlotCaptureSetting' :: Maybe DialogCodeHookInvocationSetting
codeHook = Maybe DialogCodeHookInvocationSetting
a} :: SlotCaptureSetting)

-- | Code hook called when Amazon Lex doesn\'t capture a slot value.
slotCaptureSetting_elicitationCodeHook :: Lens.Lens' SlotCaptureSetting (Prelude.Maybe ElicitationCodeHookInvocationSetting)
slotCaptureSetting_elicitationCodeHook :: Lens'
  SlotCaptureSetting (Maybe ElicitationCodeHookInvocationSetting)
slotCaptureSetting_elicitationCodeHook = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotCaptureSetting' {Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook :: Maybe ElicitationCodeHookInvocationSetting
$sel:elicitationCodeHook:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook} -> Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook) (\s :: SlotCaptureSetting
s@SlotCaptureSetting' {} Maybe ElicitationCodeHookInvocationSetting
a -> SlotCaptureSetting
s {$sel:elicitationCodeHook:SlotCaptureSetting' :: Maybe ElicitationCodeHookInvocationSetting
elicitationCodeHook = Maybe ElicitationCodeHookInvocationSetting
a} :: SlotCaptureSetting)

-- | A list of conditional branches to evaluate when the slot value isn\'t
-- captured.
slotCaptureSetting_failureConditional :: Lens.Lens' SlotCaptureSetting (Prelude.Maybe ConditionalSpecification)
slotCaptureSetting_failureConditional :: Lens' SlotCaptureSetting (Maybe ConditionalSpecification)
slotCaptureSetting_failureConditional = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotCaptureSetting' {Maybe ConditionalSpecification
failureConditional :: Maybe ConditionalSpecification
$sel:failureConditional:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ConditionalSpecification
failureConditional} -> Maybe ConditionalSpecification
failureConditional) (\s :: SlotCaptureSetting
s@SlotCaptureSetting' {} Maybe ConditionalSpecification
a -> SlotCaptureSetting
s {$sel:failureConditional:SlotCaptureSetting' :: Maybe ConditionalSpecification
failureConditional = Maybe ConditionalSpecification
a} :: SlotCaptureSetting)

-- | Specifies the next step that the bot runs when the slot value code is
-- not recognized.
slotCaptureSetting_failureNextStep :: Lens.Lens' SlotCaptureSetting (Prelude.Maybe DialogState)
slotCaptureSetting_failureNextStep :: Lens' SlotCaptureSetting (Maybe DialogState)
slotCaptureSetting_failureNextStep = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotCaptureSetting' {Maybe DialogState
failureNextStep :: Maybe DialogState
$sel:failureNextStep:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogState
failureNextStep} -> Maybe DialogState
failureNextStep) (\s :: SlotCaptureSetting
s@SlotCaptureSetting' {} Maybe DialogState
a -> SlotCaptureSetting
s {$sel:failureNextStep:SlotCaptureSetting' :: Maybe DialogState
failureNextStep = Maybe DialogState
a} :: SlotCaptureSetting)

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

instance Data.FromJSON SlotCaptureSetting where
  parseJSON :: Value -> Parser SlotCaptureSetting
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SlotCaptureSetting"
      ( \Object
x ->
          Maybe ConditionalSpecification
-> Maybe DialogState
-> Maybe ResponseSpecification
-> Maybe DialogCodeHookInvocationSetting
-> Maybe ElicitationCodeHookInvocationSetting
-> Maybe ConditionalSpecification
-> Maybe DialogState
-> Maybe ResponseSpecification
-> SlotCaptureSetting
SlotCaptureSetting'
            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
"captureConditional")
            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
"captureNextStep")
            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
"captureResponse")
            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
"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")
      )

instance Prelude.Hashable SlotCaptureSetting where
  hashWithSalt :: Int -> SlotCaptureSetting -> Int
hashWithSalt Int
_salt SlotCaptureSetting' {Maybe ElicitationCodeHookInvocationSetting
Maybe ResponseSpecification
Maybe DialogState
Maybe ConditionalSpecification
Maybe DialogCodeHookInvocationSetting
failureResponse :: Maybe ResponseSpecification
failureNextStep :: Maybe DialogState
failureConditional :: Maybe ConditionalSpecification
elicitationCodeHook :: Maybe ElicitationCodeHookInvocationSetting
codeHook :: Maybe DialogCodeHookInvocationSetting
captureResponse :: Maybe ResponseSpecification
captureNextStep :: Maybe DialogState
captureConditional :: Maybe ConditionalSpecification
$sel:failureResponse:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ResponseSpecification
$sel:failureNextStep:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogState
$sel:failureConditional:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ConditionalSpecification
$sel:elicitationCodeHook:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ElicitationCodeHookInvocationSetting
$sel:codeHook:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogCodeHookInvocationSetting
$sel:captureResponse:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ResponseSpecification
$sel:captureNextStep:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogState
$sel:captureConditional:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ConditionalSpecification
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConditionalSpecification
captureConditional
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DialogState
captureNextStep
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResponseSpecification
captureResponse
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DialogCodeHookInvocationSetting
codeHook
      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

instance Prelude.NFData SlotCaptureSetting where
  rnf :: SlotCaptureSetting -> ()
rnf SlotCaptureSetting' {Maybe ElicitationCodeHookInvocationSetting
Maybe ResponseSpecification
Maybe DialogState
Maybe ConditionalSpecification
Maybe DialogCodeHookInvocationSetting
failureResponse :: Maybe ResponseSpecification
failureNextStep :: Maybe DialogState
failureConditional :: Maybe ConditionalSpecification
elicitationCodeHook :: Maybe ElicitationCodeHookInvocationSetting
codeHook :: Maybe DialogCodeHookInvocationSetting
captureResponse :: Maybe ResponseSpecification
captureNextStep :: Maybe DialogState
captureConditional :: Maybe ConditionalSpecification
$sel:failureResponse:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ResponseSpecification
$sel:failureNextStep:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogState
$sel:failureConditional:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ConditionalSpecification
$sel:elicitationCodeHook:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ElicitationCodeHookInvocationSetting
$sel:codeHook:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogCodeHookInvocationSetting
$sel:captureResponse:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ResponseSpecification
$sel:captureNextStep:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogState
$sel:captureConditional:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ConditionalSpecification
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ConditionalSpecification
captureConditional
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DialogState
captureNextStep
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResponseSpecification
captureResponse
      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 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

instance Data.ToJSON SlotCaptureSetting where
  toJSON :: SlotCaptureSetting -> Value
toJSON SlotCaptureSetting' {Maybe ElicitationCodeHookInvocationSetting
Maybe ResponseSpecification
Maybe DialogState
Maybe ConditionalSpecification
Maybe DialogCodeHookInvocationSetting
failureResponse :: Maybe ResponseSpecification
failureNextStep :: Maybe DialogState
failureConditional :: Maybe ConditionalSpecification
elicitationCodeHook :: Maybe ElicitationCodeHookInvocationSetting
codeHook :: Maybe DialogCodeHookInvocationSetting
captureResponse :: Maybe ResponseSpecification
captureNextStep :: Maybe DialogState
captureConditional :: Maybe ConditionalSpecification
$sel:failureResponse:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ResponseSpecification
$sel:failureNextStep:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogState
$sel:failureConditional:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ConditionalSpecification
$sel:elicitationCodeHook:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ElicitationCodeHookInvocationSetting
$sel:codeHook:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogCodeHookInvocationSetting
$sel:captureResponse:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ResponseSpecification
$sel:captureNextStep:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe DialogState
$sel:captureConditional:SlotCaptureSetting' :: SlotCaptureSetting -> Maybe ConditionalSpecification
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"captureConditional" 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
captureConditional,
            (Key
"captureNextStep" 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
captureNextStep,
            (Key
"captureResponse" 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
captureResponse,
            (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
"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
          ]
      )