{-# 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.LexRuntime.Types.IntentSummary
-- 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.LexRuntime.Types.IntentSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexRuntime.Types.ConfirmationStatus
import Amazonka.LexRuntime.Types.DialogActionType
import Amazonka.LexRuntime.Types.FulfillmentState
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the state of an intent. You can use this
-- information to get the current state of an intent so that you can
-- process the intent, or so that you can return the intent to its previous
-- state.
--
-- /See:/ 'newIntentSummary' smart constructor.
data IntentSummary = IntentSummary'
  { -- | A user-defined label that identifies a particular intent. You can use
    -- this label to return to a previous intent.
    --
    -- Use the @checkpointLabelFilter@ parameter of the @GetSessionRequest@
    -- operation to filter the intents returned by the operation to those with
    -- only the specified label.
    IntentSummary -> Maybe Text
checkpointLabel :: Prelude.Maybe Prelude.Text,
    -- | The status of the intent after the user responds to the confirmation
    -- prompt. If the user confirms the intent, Amazon Lex sets this field to
    -- @Confirmed@. If the user denies the intent, Amazon Lex sets this value
    -- to @Denied@. The possible values are:
    --
    -- -   @Confirmed@ - The user has responded \"Yes\" to the confirmation
    --     prompt, confirming that the intent is complete and that it is ready
    --     to be fulfilled.
    --
    -- -   @Denied@ - The user has responded \"No\" to the confirmation prompt.
    --
    -- -   @None@ - The user has never been prompted for confirmation; or, the
    --     user was prompted but did not confirm or deny the prompt.
    IntentSummary -> Maybe ConfirmationStatus
confirmationStatus :: Prelude.Maybe ConfirmationStatus,
    -- | The fulfillment state of the intent. The possible values are:
    --
    -- -   @Failed@ - The Lambda function associated with the intent failed to
    --     fulfill the intent.
    --
    -- -   @Fulfilled@ - The intent has fulfilled by the Lambda function
    --     associated with the intent.
    --
    -- -   @ReadyForFulfillment@ - All of the information necessary for the
    --     intent is present and the intent ready to be fulfilled by the client
    --     application.
    IntentSummary -> Maybe FulfillmentState
fulfillmentState :: Prelude.Maybe FulfillmentState,
    -- | The name of the intent.
    IntentSummary -> Maybe Text
intentName :: Prelude.Maybe Prelude.Text,
    -- | The next slot to elicit from the user. If there is not slot to elicit,
    -- the field is blank.
    IntentSummary -> Maybe Text
slotToElicit :: Prelude.Maybe Prelude.Text,
    -- | Map of the slots that have been gathered and their values.
    IntentSummary -> Maybe (Sensitive (HashMap Text Text))
slots :: Prelude.Maybe (Data.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
    -- | The next action that the bot should take in its interaction with the
    -- user. The possible values are:
    --
    -- -   @ConfirmIntent@ - The next action is asking the user if the intent
    --     is complete and ready to be fulfilled. This is a yes\/no question
    --     such as \"Place the order?\"
    --
    -- -   @Close@ - Indicates that the there will not be a response from the
    --     user. For example, the statement \"Your order has been placed\" does
    --     not require a response.
    --
    -- -   @ElicitIntent@ - The next action is to determine the intent that the
    --     user wants to fulfill.
    --
    -- -   @ElicitSlot@ - The next action is to elicit a slot value from the
    --     user.
    IntentSummary -> DialogActionType
dialogActionType :: DialogActionType
  }
  deriving (IntentSummary -> IntentSummary -> Bool
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
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. 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)

-- |
-- Create a value of 'IntentSummary' 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:
--
-- 'checkpointLabel', 'intentSummary_checkpointLabel' - A user-defined label that identifies a particular intent. You can use
-- this label to return to a previous intent.
--
-- Use the @checkpointLabelFilter@ parameter of the @GetSessionRequest@
-- operation to filter the intents returned by the operation to those with
-- only the specified label.
--
-- 'confirmationStatus', 'intentSummary_confirmationStatus' - The status of the intent after the user responds to the confirmation
-- prompt. If the user confirms the intent, Amazon Lex sets this field to
-- @Confirmed@. If the user denies the intent, Amazon Lex sets this value
-- to @Denied@. The possible values are:
--
-- -   @Confirmed@ - The user has responded \"Yes\" to the confirmation
--     prompt, confirming that the intent is complete and that it is ready
--     to be fulfilled.
--
-- -   @Denied@ - The user has responded \"No\" to the confirmation prompt.
--
-- -   @None@ - The user has never been prompted for confirmation; or, the
--     user was prompted but did not confirm or deny the prompt.
--
-- 'fulfillmentState', 'intentSummary_fulfillmentState' - The fulfillment state of the intent. The possible values are:
--
-- -   @Failed@ - The Lambda function associated with the intent failed to
--     fulfill the intent.
--
-- -   @Fulfilled@ - The intent has fulfilled by the Lambda function
--     associated with the intent.
--
-- -   @ReadyForFulfillment@ - All of the information necessary for the
--     intent is present and the intent ready to be fulfilled by the client
--     application.
--
-- 'intentName', 'intentSummary_intentName' - The name of the intent.
--
-- 'slotToElicit', 'intentSummary_slotToElicit' - The next slot to elicit from the user. If there is not slot to elicit,
-- the field is blank.
--
-- 'slots', 'intentSummary_slots' - Map of the slots that have been gathered and their values.
--
-- 'dialogActionType', 'intentSummary_dialogActionType' - The next action that the bot should take in its interaction with the
-- user. The possible values are:
--
-- -   @ConfirmIntent@ - The next action is asking the user if the intent
--     is complete and ready to be fulfilled. This is a yes\/no question
--     such as \"Place the order?\"
--
-- -   @Close@ - Indicates that the there will not be a response from the
--     user. For example, the statement \"Your order has been placed\" does
--     not require a response.
--
-- -   @ElicitIntent@ - The next action is to determine the intent that the
--     user wants to fulfill.
--
-- -   @ElicitSlot@ - The next action is to elicit a slot value from the
--     user.
newIntentSummary ::
  -- | 'dialogActionType'
  DialogActionType ->
  IntentSummary
newIntentSummary :: DialogActionType -> IntentSummary
newIntentSummary DialogActionType
pDialogActionType_ =
  IntentSummary'
    { $sel:checkpointLabel:IntentSummary' :: Maybe Text
checkpointLabel = forall a. Maybe a
Prelude.Nothing,
      $sel:confirmationStatus:IntentSummary' :: Maybe ConfirmationStatus
confirmationStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:fulfillmentState:IntentSummary' :: Maybe FulfillmentState
fulfillmentState = forall a. Maybe a
Prelude.Nothing,
      $sel:intentName:IntentSummary' :: Maybe Text
intentName = forall a. Maybe a
Prelude.Nothing,
      $sel:slotToElicit:IntentSummary' :: Maybe Text
slotToElicit = forall a. Maybe a
Prelude.Nothing,
      $sel:slots:IntentSummary' :: Maybe (Sensitive (HashMap Text Text))
slots = forall a. Maybe a
Prelude.Nothing,
      $sel:dialogActionType:IntentSummary' :: DialogActionType
dialogActionType = DialogActionType
pDialogActionType_
    }

-- | A user-defined label that identifies a particular intent. You can use
-- this label to return to a previous intent.
--
-- Use the @checkpointLabelFilter@ parameter of the @GetSessionRequest@
-- operation to filter the intents returned by the operation to those with
-- only the specified label.
intentSummary_checkpointLabel :: Lens.Lens' IntentSummary (Prelude.Maybe Prelude.Text)
intentSummary_checkpointLabel :: Lens' IntentSummary (Maybe Text)
intentSummary_checkpointLabel = 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)

-- | The status of the intent after the user responds to the confirmation
-- prompt. If the user confirms the intent, Amazon Lex sets this field to
-- @Confirmed@. If the user denies the intent, Amazon Lex sets this value
-- to @Denied@. The possible values are:
--
-- -   @Confirmed@ - The user has responded \"Yes\" to the confirmation
--     prompt, confirming that the intent is complete and that it is ready
--     to be fulfilled.
--
-- -   @Denied@ - The user has responded \"No\" to the confirmation prompt.
--
-- -   @None@ - The user has never been prompted for confirmation; or, the
--     user was prompted but did not confirm or deny the prompt.
intentSummary_confirmationStatus :: Lens.Lens' IntentSummary (Prelude.Maybe ConfirmationStatus)
intentSummary_confirmationStatus :: Lens' IntentSummary (Maybe ConfirmationStatus)
intentSummary_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)

-- | The fulfillment state of the intent. The possible values are:
--
-- -   @Failed@ - The Lambda function associated with the intent failed to
--     fulfill the intent.
--
-- -   @Fulfilled@ - The intent has fulfilled by the Lambda function
--     associated with the intent.
--
-- -   @ReadyForFulfillment@ - All of the information necessary for the
--     intent is present and the intent ready to be fulfilled by the client
--     application.
intentSummary_fulfillmentState :: Lens.Lens' IntentSummary (Prelude.Maybe FulfillmentState)
intentSummary_fulfillmentState :: Lens' IntentSummary (Maybe FulfillmentState)
intentSummary_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)

-- | The name of the intent.
intentSummary_intentName :: Lens.Lens' IntentSummary (Prelude.Maybe Prelude.Text)
intentSummary_intentName :: Lens' IntentSummary (Maybe Text)
intentSummary_intentName = 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)

-- | The next slot to elicit from the user. If there is not slot to elicit,
-- the field is blank.
intentSummary_slotToElicit :: Lens.Lens' IntentSummary (Prelude.Maybe Prelude.Text)
intentSummary_slotToElicit :: Lens' IntentSummary (Maybe Text)
intentSummary_slotToElicit = 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)

-- | Map of the slots that have been gathered and their values.
intentSummary_slots :: Lens.Lens' IntentSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
intentSummary_slots :: Lens' IntentSummary (Maybe (HashMap Text Text))
intentSummary_slots = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 (forall a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | The next action that the bot should take in its interaction with the
-- user. The possible values are:
--
-- -   @ConfirmIntent@ - The next action is asking the user if the intent
--     is complete and ready to be fulfilled. This is a yes\/no question
--     such as \"Place the order?\"
--
-- -   @Close@ - Indicates that the there will not be a response from the
--     user. For example, the statement \"Your order has been placed\" does
--     not require a response.
--
-- -   @ElicitIntent@ - The next action is to determine the intent that the
--     user wants to fulfill.
--
-- -   @ElicitSlot@ - The next action is to elicit a slot value from the
--     user.
intentSummary_dialogActionType :: Lens.Lens' IntentSummary DialogActionType
intentSummary_dialogActionType :: Lens' IntentSummary DialogActionType
intentSummary_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 Data.FromJSON IntentSummary where
  parseJSON :: Value -> Parser IntentSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"IntentSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe ConfirmationStatus
-> Maybe FulfillmentState
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> DialogActionType
-> IntentSummary
IntentSummary'
            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
"checkpointLabel")
            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
"confirmationStatus")
            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
"fulfillmentState")
            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
"intentName")
            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
"slotToElicit")
            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
"slots" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"dialogActionType")
      )

instance Prelude.Hashable IntentSummary where
  hashWithSalt :: Int -> IntentSummary -> Int
hashWithSalt Int
_salt IntentSummary' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe ConfirmationStatus
Maybe FulfillmentState
DialogActionType
dialogActionType :: DialogActionType
slots :: Maybe (Sensitive (HashMap Text Text))
slotToElicit :: Maybe Text
intentName :: Maybe Text
fulfillmentState :: Maybe FulfillmentState
confirmationStatus :: Maybe ConfirmationStatus
checkpointLabel :: Maybe Text
$sel:dialogActionType:IntentSummary' :: IntentSummary -> DialogActionType
$sel:slots:IntentSummary' :: IntentSummary -> Maybe (Sensitive (HashMap Text Text))
$sel:slotToElicit:IntentSummary' :: IntentSummary -> Maybe Text
$sel:intentName:IntentSummary' :: IntentSummary -> Maybe Text
$sel:fulfillmentState:IntentSummary' :: IntentSummary -> Maybe FulfillmentState
$sel:confirmationStatus:IntentSummary' :: IntentSummary -> Maybe ConfirmationStatus
$sel:checkpointLabel:IntentSummary' :: IntentSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
checkpointLabel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConfirmationStatus
confirmationStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FulfillmentState
fulfillmentState
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
intentName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
slotToElicit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive (HashMap Text Text))
slots
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DialogActionType
dialogActionType

instance Prelude.NFData IntentSummary where
  rnf :: IntentSummary -> ()
rnf IntentSummary' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe ConfirmationStatus
Maybe FulfillmentState
DialogActionType
dialogActionType :: DialogActionType
slots :: Maybe (Sensitive (HashMap Text Text))
slotToElicit :: Maybe Text
intentName :: Maybe Text
fulfillmentState :: Maybe FulfillmentState
confirmationStatus :: Maybe ConfirmationStatus
checkpointLabel :: Maybe Text
$sel:dialogActionType:IntentSummary' :: IntentSummary -> DialogActionType
$sel:slots:IntentSummary' :: IntentSummary -> Maybe (Sensitive (HashMap Text Text))
$sel:slotToElicit:IntentSummary' :: IntentSummary -> Maybe Text
$sel:intentName:IntentSummary' :: IntentSummary -> Maybe Text
$sel:fulfillmentState:IntentSummary' :: IntentSummary -> Maybe FulfillmentState
$sel:confirmationStatus:IntentSummary' :: IntentSummary -> Maybe ConfirmationStatus
$sel:checkpointLabel:IntentSummary' :: IntentSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
checkpointLabel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConfirmationStatus
confirmationStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FulfillmentState
fulfillmentState
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
intentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
slotToElicit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive (HashMap Text Text))
slots
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DialogActionType
dialogActionType

instance Data.ToJSON IntentSummary where
  toJSON :: IntentSummary -> Value
toJSON IntentSummary' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe ConfirmationStatus
Maybe FulfillmentState
DialogActionType
dialogActionType :: DialogActionType
slots :: Maybe (Sensitive (HashMap Text Text))
slotToElicit :: Maybe Text
intentName :: Maybe Text
fulfillmentState :: Maybe FulfillmentState
confirmationStatus :: Maybe ConfirmationStatus
checkpointLabel :: Maybe Text
$sel:dialogActionType:IntentSummary' :: IntentSummary -> DialogActionType
$sel:slots:IntentSummary' :: IntentSummary -> Maybe (Sensitive (HashMap Text Text))
$sel:slotToElicit:IntentSummary' :: IntentSummary -> Maybe Text
$sel:intentName:IntentSummary' :: IntentSummary -> Maybe Text
$sel:fulfillmentState:IntentSummary' :: IntentSummary -> Maybe FulfillmentState
$sel:confirmationStatus:IntentSummary' :: IntentSummary -> Maybe ConfirmationStatus
$sel:checkpointLabel:IntentSummary' :: IntentSummary -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"checkpointLabel" 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 Text
checkpointLabel,
            (Key
"confirmationStatus" 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 ConfirmationStatus
confirmationStatus,
            (Key
"fulfillmentState" 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 FulfillmentState
fulfillmentState,
            (Key
"intentName" 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 Text
intentName,
            (Key
"slotToElicit" 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 Text
slotToElicit,
            (Key
"slots" 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 (Sensitive (HashMap Text Text))
slots,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"dialogActionType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DialogActionType
dialogActionType)
          ]
      )