{-# 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 #-}
module Amazonka.LexRuntime.Types.IntentSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LexRuntime.Types.ConfirmationStatus
import Amazonka.LexRuntime.Types.DialogActionType
import Amazonka.LexRuntime.Types.FulfillmentState
import qualified Amazonka.Prelude as Prelude
data IntentSummary = IntentSummary'
{
IntentSummary -> Maybe Text
checkpointLabel :: Prelude.Maybe Prelude.Text,
IntentSummary -> Maybe (Sensitive (HashMap Text Text))
slots :: Prelude.Maybe (Core.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
IntentSummary -> Maybe Text
intentName :: Prelude.Maybe Prelude.Text,
IntentSummary -> Maybe FulfillmentState
fulfillmentState :: Prelude.Maybe FulfillmentState,
IntentSummary -> Maybe ConfirmationStatus
confirmationStatus :: Prelude.Maybe ConfirmationStatus,
IntentSummary -> Maybe Text
slotToElicit :: Prelude.Maybe Prelude.Text,
IntentSummary -> DialogActionType
dialogActionType :: DialogActionType
}
deriving (IntentSummary -> IntentSummary -> Bool
(IntentSummary -> IntentSummary -> Bool)
-> (IntentSummary -> IntentSummary -> Bool) -> Eq IntentSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IntentSummary -> IntentSummary -> Bool
$c/= :: IntentSummary -> IntentSummary -> Bool
== :: IntentSummary -> IntentSummary -> Bool
$c== :: IntentSummary -> IntentSummary -> Bool
Prelude.Eq, Int -> IntentSummary -> ShowS
[IntentSummary] -> ShowS
IntentSummary -> String
(Int -> IntentSummary -> ShowS)
-> (IntentSummary -> String)
-> ([IntentSummary] -> ShowS)
-> Show IntentSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IntentSummary] -> ShowS
$cshowList :: [IntentSummary] -> ShowS
show :: IntentSummary -> String
$cshow :: IntentSummary -> String
showsPrec :: Int -> IntentSummary -> ShowS
$cshowsPrec :: Int -> IntentSummary -> ShowS
Prelude.Show, (forall x. IntentSummary -> Rep IntentSummary x)
-> (forall x. Rep IntentSummary x -> IntentSummary)
-> Generic IntentSummary
forall x. Rep IntentSummary x -> IntentSummary
forall x. IntentSummary -> Rep IntentSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IntentSummary x -> IntentSummary
$cfrom :: forall x. IntentSummary -> Rep IntentSummary x
Prelude.Generic)
newIntentSummary ::
DialogActionType ->
IntentSummary
newIntentSummary :: DialogActionType -> IntentSummary
newIntentSummary DialogActionType
pDialogActionType_ =
IntentSummary' :: Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Maybe Text
-> Maybe FulfillmentState
-> Maybe ConfirmationStatus
-> Maybe Text
-> DialogActionType
-> IntentSummary
IntentSummary'
{ $sel:checkpointLabel:IntentSummary' :: Maybe Text
checkpointLabel = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:slots:IntentSummary' :: Maybe (Sensitive (HashMap Text Text))
slots = Maybe (Sensitive (HashMap Text Text))
forall a. Maybe a
Prelude.Nothing,
$sel:intentName:IntentSummary' :: Maybe Text
intentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fulfillmentState:IntentSummary' :: Maybe FulfillmentState
fulfillmentState = Maybe FulfillmentState
forall a. Maybe a
Prelude.Nothing,
$sel:confirmationStatus:IntentSummary' :: Maybe ConfirmationStatus
confirmationStatus = Maybe ConfirmationStatus
forall a. Maybe a
Prelude.Nothing,
$sel:slotToElicit:IntentSummary' :: Maybe Text
slotToElicit = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dialogActionType:IntentSummary' :: DialogActionType
dialogActionType = DialogActionType
pDialogActionType_
}
intentSummary_checkpointLabel :: Lens.Lens' IntentSummary (Prelude.Maybe Prelude.Text)
intentSummary_checkpointLabel :: (Maybe Text -> f (Maybe Text)) -> IntentSummary -> f IntentSummary
intentSummary_checkpointLabel = (IntentSummary -> Maybe Text)
-> (IntentSummary -> Maybe Text -> IntentSummary)
-> Lens IntentSummary IntentSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentSummary' {Maybe Text
checkpointLabel :: Maybe Text
$sel:checkpointLabel:IntentSummary' :: IntentSummary -> Maybe Text
checkpointLabel} -> Maybe Text
checkpointLabel) (\s :: IntentSummary
s@IntentSummary' {} Maybe Text
a -> IntentSummary
s {$sel:checkpointLabel:IntentSummary' :: Maybe Text
checkpointLabel = Maybe Text
a} :: IntentSummary)
intentSummary_slots :: Lens.Lens' IntentSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
intentSummary_slots :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> IntentSummary -> f IntentSummary
intentSummary_slots = (IntentSummary -> Maybe (Sensitive (HashMap Text Text)))
-> (IntentSummary
-> Maybe (Sensitive (HashMap Text Text)) -> IntentSummary)
-> Lens
IntentSummary
IntentSummary
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (Sensitive (HashMap Text Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentSummary' {Maybe (Sensitive (HashMap Text Text))
slots :: Maybe (Sensitive (HashMap Text Text))
$sel:slots:IntentSummary' :: IntentSummary -> Maybe (Sensitive (HashMap Text Text))
slots} -> Maybe (Sensitive (HashMap Text Text))
slots) (\s :: IntentSummary
s@IntentSummary' {} Maybe (Sensitive (HashMap Text Text))
a -> IntentSummary
s {$sel:slots:IntentSummary' :: Maybe (Sensitive (HashMap Text Text))
slots = Maybe (Sensitive (HashMap Text Text))
a} :: IntentSummary) ((Maybe (Sensitive (HashMap Text Text))
-> f (Maybe (Sensitive (HashMap Text Text))))
-> IntentSummary -> f IntentSummary)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (Sensitive (HashMap Text Text))
-> f (Maybe (Sensitive (HashMap Text Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> IntentSummary
-> f IntentSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping (AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
-> (Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text)))
-> AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)
intentSummary_intentName :: Lens.Lens' IntentSummary (Prelude.Maybe Prelude.Text)
intentSummary_intentName :: (Maybe Text -> f (Maybe Text)) -> IntentSummary -> f IntentSummary
intentSummary_intentName = (IntentSummary -> Maybe Text)
-> (IntentSummary -> Maybe Text -> IntentSummary)
-> Lens IntentSummary IntentSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentSummary' {Maybe Text
intentName :: Maybe Text
$sel:intentName:IntentSummary' :: IntentSummary -> Maybe Text
intentName} -> Maybe Text
intentName) (\s :: IntentSummary
s@IntentSummary' {} Maybe Text
a -> IntentSummary
s {$sel:intentName:IntentSummary' :: Maybe Text
intentName = Maybe Text
a} :: IntentSummary)
intentSummary_fulfillmentState :: Lens.Lens' IntentSummary (Prelude.Maybe FulfillmentState)
intentSummary_fulfillmentState :: (Maybe FulfillmentState -> f (Maybe FulfillmentState))
-> IntentSummary -> f IntentSummary
intentSummary_fulfillmentState = (IntentSummary -> Maybe FulfillmentState)
-> (IntentSummary -> Maybe FulfillmentState -> IntentSummary)
-> Lens
IntentSummary
IntentSummary
(Maybe FulfillmentState)
(Maybe FulfillmentState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentSummary' {Maybe FulfillmentState
fulfillmentState :: Maybe FulfillmentState
$sel:fulfillmentState:IntentSummary' :: IntentSummary -> Maybe FulfillmentState
fulfillmentState} -> Maybe FulfillmentState
fulfillmentState) (\s :: IntentSummary
s@IntentSummary' {} Maybe FulfillmentState
a -> IntentSummary
s {$sel:fulfillmentState:IntentSummary' :: Maybe FulfillmentState
fulfillmentState = Maybe FulfillmentState
a} :: IntentSummary)
intentSummary_confirmationStatus :: Lens.Lens' IntentSummary (Prelude.Maybe ConfirmationStatus)
intentSummary_confirmationStatus :: (Maybe ConfirmationStatus -> f (Maybe ConfirmationStatus))
-> IntentSummary -> f IntentSummary
intentSummary_confirmationStatus = (IntentSummary -> Maybe ConfirmationStatus)
-> (IntentSummary -> Maybe ConfirmationStatus -> IntentSummary)
-> Lens
IntentSummary
IntentSummary
(Maybe ConfirmationStatus)
(Maybe ConfirmationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentSummary' {Maybe ConfirmationStatus
confirmationStatus :: Maybe ConfirmationStatus
$sel:confirmationStatus:IntentSummary' :: IntentSummary -> Maybe ConfirmationStatus
confirmationStatus} -> Maybe ConfirmationStatus
confirmationStatus) (\s :: IntentSummary
s@IntentSummary' {} Maybe ConfirmationStatus
a -> IntentSummary
s {$sel:confirmationStatus:IntentSummary' :: Maybe ConfirmationStatus
confirmationStatus = Maybe ConfirmationStatus
a} :: IntentSummary)
intentSummary_slotToElicit :: Lens.Lens' IntentSummary (Prelude.Maybe Prelude.Text)
intentSummary_slotToElicit :: (Maybe Text -> f (Maybe Text)) -> IntentSummary -> f IntentSummary
intentSummary_slotToElicit = (IntentSummary -> Maybe Text)
-> (IntentSummary -> Maybe Text -> IntentSummary)
-> Lens IntentSummary IntentSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentSummary' {Maybe Text
slotToElicit :: Maybe Text
$sel:slotToElicit:IntentSummary' :: IntentSummary -> Maybe Text
slotToElicit} -> Maybe Text
slotToElicit) (\s :: IntentSummary
s@IntentSummary' {} Maybe Text
a -> IntentSummary
s {$sel:slotToElicit:IntentSummary' :: Maybe Text
slotToElicit = Maybe Text
a} :: IntentSummary)
intentSummary_dialogActionType :: Lens.Lens' IntentSummary DialogActionType
intentSummary_dialogActionType :: (DialogActionType -> f DialogActionType)
-> IntentSummary -> f IntentSummary
intentSummary_dialogActionType = (IntentSummary -> DialogActionType)
-> (IntentSummary -> DialogActionType -> IntentSummary)
-> Lens
IntentSummary IntentSummary DialogActionType DialogActionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentSummary' {DialogActionType
dialogActionType :: DialogActionType
$sel:dialogActionType:IntentSummary' :: IntentSummary -> DialogActionType
dialogActionType} -> DialogActionType
dialogActionType) (\s :: IntentSummary
s@IntentSummary' {} DialogActionType
a -> IntentSummary
s {$sel:dialogActionType:IntentSummary' :: DialogActionType
dialogActionType = DialogActionType
a} :: IntentSummary)
instance Core.FromJSON IntentSummary where
parseJSON :: Value -> Parser IntentSummary
parseJSON =
String
-> (Object -> Parser IntentSummary)
-> Value
-> Parser IntentSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IntentSummary"
( \Object
x ->
Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Maybe Text
-> Maybe FulfillmentState
-> Maybe ConfirmationStatus
-> Maybe Text
-> DialogActionType
-> IntentSummary
IntentSummary'
(Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Maybe Text
-> Maybe FulfillmentState
-> Maybe ConfirmationStatus
-> Maybe Text
-> DialogActionType
-> IntentSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe (Sensitive (HashMap Text Text))
-> Maybe Text
-> Maybe FulfillmentState
-> Maybe ConfirmationStatus
-> Maybe Text
-> DialogActionType
-> IntentSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"checkpointLabel")
Parser
(Maybe (Sensitive (HashMap Text Text))
-> Maybe Text
-> Maybe FulfillmentState
-> Maybe ConfirmationStatus
-> Maybe Text
-> DialogActionType
-> IntentSummary)
-> Parser (Maybe (Sensitive (HashMap Text Text)))
-> Parser
(Maybe Text
-> Maybe FulfillmentState
-> Maybe ConfirmationStatus
-> Maybe Text
-> DialogActionType
-> IntentSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe (Sensitive (HashMap Text Text))))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"slots" Parser (Maybe (Maybe (Sensitive (HashMap Text Text))))
-> Maybe (Sensitive (HashMap Text Text))
-> Parser (Maybe (Sensitive (HashMap Text Text)))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (Sensitive (HashMap Text Text))
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe FulfillmentState
-> Maybe ConfirmationStatus
-> Maybe Text
-> DialogActionType
-> IntentSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe FulfillmentState
-> Maybe ConfirmationStatus
-> Maybe Text
-> DialogActionType
-> IntentSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"intentName")
Parser
(Maybe FulfillmentState
-> Maybe ConfirmationStatus
-> Maybe Text
-> DialogActionType
-> IntentSummary)
-> Parser (Maybe FulfillmentState)
-> Parser
(Maybe ConfirmationStatus
-> Maybe Text -> DialogActionType -> IntentSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FulfillmentState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fulfillmentState")
Parser
(Maybe ConfirmationStatus
-> Maybe Text -> DialogActionType -> IntentSummary)
-> Parser (Maybe ConfirmationStatus)
-> Parser (Maybe Text -> DialogActionType -> IntentSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConfirmationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"confirmationStatus")
Parser (Maybe Text -> DialogActionType -> IntentSummary)
-> Parser (Maybe Text)
-> Parser (DialogActionType -> IntentSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"slotToElicit")
Parser (DialogActionType -> IntentSummary)
-> Parser DialogActionType -> Parser IntentSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DialogActionType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"dialogActionType")
)
instance Prelude.Hashable IntentSummary
instance Prelude.NFData IntentSummary
instance Core.ToJSON IntentSummary where
toJSON :: IntentSummary -> Value
toJSON IntentSummary' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe ConfirmationStatus
Maybe FulfillmentState
DialogActionType
dialogActionType :: DialogActionType
slotToElicit :: Maybe Text
confirmationStatus :: Maybe ConfirmationStatus
fulfillmentState :: Maybe FulfillmentState
intentName :: Maybe Text
slots :: Maybe (Sensitive (HashMap Text Text))
checkpointLabel :: Maybe Text
$sel:dialogActionType:IntentSummary' :: IntentSummary -> DialogActionType
$sel:slotToElicit:IntentSummary' :: IntentSummary -> Maybe Text
$sel:confirmationStatus:IntentSummary' :: IntentSummary -> Maybe ConfirmationStatus
$sel:fulfillmentState:IntentSummary' :: IntentSummary -> Maybe FulfillmentState
$sel:intentName:IntentSummary' :: IntentSummary -> Maybe Text
$sel:slots:IntentSummary' :: IntentSummary -> Maybe (Sensitive (HashMap Text Text))
$sel:checkpointLabel:IntentSummary' :: IntentSummary -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"checkpointLabel" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
checkpointLabel,
(Text
"slots" Text -> Sensitive (HashMap Text Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive (HashMap Text Text) -> Pair)
-> Maybe (Sensitive (HashMap Text Text)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (HashMap Text Text))
slots,
(Text
"intentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
intentName,
(Text
"fulfillmentState" Text -> FulfillmentState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(FulfillmentState -> Pair) -> Maybe FulfillmentState -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FulfillmentState
fulfillmentState,
(Text
"confirmationStatus" Text -> ConfirmationStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ConfirmationStatus -> Pair)
-> Maybe ConfirmationStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConfirmationStatus
confirmationStatus,
(Text
"slotToElicit" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
slotToElicit,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"dialogActionType" Text -> DialogActionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DialogActionType
dialogActionType)
]
)