{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.GetSession
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns session information for a specified bot, alias, and user ID.
module Amazonka.LexRuntime.GetSession
  ( -- * Creating a Request
    GetSession (..),
    newGetSession,

    -- * Request Lenses
    getSession_checkpointLabelFilter,
    getSession_botName,
    getSession_botAlias,
    getSession_userId,

    -- * Destructuring the Response
    GetSessionResponse (..),
    newGetSessionResponse,

    -- * Response Lenses
    getSessionResponse_activeContexts,
    getSessionResponse_sessionId,
    getSessionResponse_recentIntentSummaryView,
    getSessionResponse_dialogAction,
    getSessionResponse_sessionAttributes,
    getSessionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LexRuntime.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetSession' smart constructor.
data GetSession = GetSession'
  { -- | A string used to filter the intents returned in the
    -- @recentIntentSummaryView@ structure.
    --
    -- When you specify a filter, only intents with their @checkpointLabel@
    -- field set to that string are returned.
    GetSession -> Maybe Text
checkpointLabelFilter :: Prelude.Maybe Prelude.Text,
    -- | The name of the bot that contains the session data.
    GetSession -> Text
botName :: Prelude.Text,
    -- | The alias in use for the bot that contains the session data.
    GetSession -> Text
botAlias :: Prelude.Text,
    -- | The ID of the client application user. Amazon Lex uses this to identify
    -- a user\'s conversation with your bot.
    GetSession -> Text
userId :: Prelude.Text
  }
  deriving (GetSession -> GetSession -> Bool
(GetSession -> GetSession -> Bool)
-> (GetSession -> GetSession -> Bool) -> Eq GetSession
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSession -> GetSession -> Bool
$c/= :: GetSession -> GetSession -> Bool
== :: GetSession -> GetSession -> Bool
$c== :: GetSession -> GetSession -> Bool
Prelude.Eq, ReadPrec [GetSession]
ReadPrec GetSession
Int -> ReadS GetSession
ReadS [GetSession]
(Int -> ReadS GetSession)
-> ReadS [GetSession]
-> ReadPrec GetSession
-> ReadPrec [GetSession]
-> Read GetSession
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSession]
$creadListPrec :: ReadPrec [GetSession]
readPrec :: ReadPrec GetSession
$creadPrec :: ReadPrec GetSession
readList :: ReadS [GetSession]
$creadList :: ReadS [GetSession]
readsPrec :: Int -> ReadS GetSession
$creadsPrec :: Int -> ReadS GetSession
Prelude.Read, Int -> GetSession -> ShowS
[GetSession] -> ShowS
GetSession -> String
(Int -> GetSession -> ShowS)
-> (GetSession -> String)
-> ([GetSession] -> ShowS)
-> Show GetSession
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSession] -> ShowS
$cshowList :: [GetSession] -> ShowS
show :: GetSession -> String
$cshow :: GetSession -> String
showsPrec :: Int -> GetSession -> ShowS
$cshowsPrec :: Int -> GetSession -> ShowS
Prelude.Show, (forall x. GetSession -> Rep GetSession x)
-> (forall x. Rep GetSession x -> GetSession) -> Generic GetSession
forall x. Rep GetSession x -> GetSession
forall x. GetSession -> Rep GetSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSession x -> GetSession
$cfrom :: forall x. GetSession -> Rep GetSession x
Prelude.Generic)

-- |
-- Create a value of 'GetSession' 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:
--
-- 'checkpointLabelFilter', 'getSession_checkpointLabelFilter' - A string used to filter the intents returned in the
-- @recentIntentSummaryView@ structure.
--
-- When you specify a filter, only intents with their @checkpointLabel@
-- field set to that string are returned.
--
-- 'botName', 'getSession_botName' - The name of the bot that contains the session data.
--
-- 'botAlias', 'getSession_botAlias' - The alias in use for the bot that contains the session data.
--
-- 'userId', 'getSession_userId' - The ID of the client application user. Amazon Lex uses this to identify
-- a user\'s conversation with your bot.
newGetSession ::
  -- | 'botName'
  Prelude.Text ->
  -- | 'botAlias'
  Prelude.Text ->
  -- | 'userId'
  Prelude.Text ->
  GetSession
newGetSession :: Text -> Text -> Text -> GetSession
newGetSession Text
pBotName_ Text
pBotAlias_ Text
pUserId_ =
  GetSession' :: Maybe Text -> Text -> Text -> Text -> GetSession
GetSession'
    { $sel:checkpointLabelFilter:GetSession' :: Maybe Text
checkpointLabelFilter =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:botName:GetSession' :: Text
botName = Text
pBotName_,
      $sel:botAlias:GetSession' :: Text
botAlias = Text
pBotAlias_,
      $sel:userId:GetSession' :: Text
userId = Text
pUserId_
    }

-- | A string used to filter the intents returned in the
-- @recentIntentSummaryView@ structure.
--
-- When you specify a filter, only intents with their @checkpointLabel@
-- field set to that string are returned.
getSession_checkpointLabelFilter :: Lens.Lens' GetSession (Prelude.Maybe Prelude.Text)
getSession_checkpointLabelFilter :: (Maybe Text -> f (Maybe Text)) -> GetSession -> f GetSession
getSession_checkpointLabelFilter = (GetSession -> Maybe Text)
-> (GetSession -> Maybe Text -> GetSession)
-> Lens GetSession GetSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSession' {Maybe Text
checkpointLabelFilter :: Maybe Text
$sel:checkpointLabelFilter:GetSession' :: GetSession -> Maybe Text
checkpointLabelFilter} -> Maybe Text
checkpointLabelFilter) (\s :: GetSession
s@GetSession' {} Maybe Text
a -> GetSession
s {$sel:checkpointLabelFilter:GetSession' :: Maybe Text
checkpointLabelFilter = Maybe Text
a} :: GetSession)

-- | The name of the bot that contains the session data.
getSession_botName :: Lens.Lens' GetSession Prelude.Text
getSession_botName :: (Text -> f Text) -> GetSession -> f GetSession
getSession_botName = (GetSession -> Text)
-> (GetSession -> Text -> GetSession)
-> Lens GetSession GetSession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSession' {Text
botName :: Text
$sel:botName:GetSession' :: GetSession -> Text
botName} -> Text
botName) (\s :: GetSession
s@GetSession' {} Text
a -> GetSession
s {$sel:botName:GetSession' :: Text
botName = Text
a} :: GetSession)

-- | The alias in use for the bot that contains the session data.
getSession_botAlias :: Lens.Lens' GetSession Prelude.Text
getSession_botAlias :: (Text -> f Text) -> GetSession -> f GetSession
getSession_botAlias = (GetSession -> Text)
-> (GetSession -> Text -> GetSession)
-> Lens GetSession GetSession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSession' {Text
botAlias :: Text
$sel:botAlias:GetSession' :: GetSession -> Text
botAlias} -> Text
botAlias) (\s :: GetSession
s@GetSession' {} Text
a -> GetSession
s {$sel:botAlias:GetSession' :: Text
botAlias = Text
a} :: GetSession)

-- | The ID of the client application user. Amazon Lex uses this to identify
-- a user\'s conversation with your bot.
getSession_userId :: Lens.Lens' GetSession Prelude.Text
getSession_userId :: (Text -> f Text) -> GetSession -> f GetSession
getSession_userId = (GetSession -> Text)
-> (GetSession -> Text -> GetSession)
-> Lens GetSession GetSession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSession' {Text
userId :: Text
$sel:userId:GetSession' :: GetSession -> Text
userId} -> Text
userId) (\s :: GetSession
s@GetSession' {} Text
a -> GetSession
s {$sel:userId:GetSession' :: Text
userId = Text
a} :: GetSession)

instance Core.AWSRequest GetSession where
  type AWSResponse GetSession = GetSessionResponse
  request :: GetSession -> Request GetSession
request = Service -> GetSession -> Request GetSession
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetSession
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSession)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetSession))
-> Logger
-> Service
-> Proxy GetSession
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSession)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (Sensitive [ActiveContext])
-> Maybe Text
-> Maybe [IntentSummary]
-> Maybe DialogAction
-> Maybe (Sensitive (HashMap Text Text))
-> Int
-> GetSessionResponse
GetSessionResponse'
            (Maybe (Sensitive [ActiveContext])
 -> Maybe Text
 -> Maybe [IntentSummary]
 -> Maybe DialogAction
 -> Maybe (Sensitive (HashMap Text Text))
 -> Int
 -> GetSessionResponse)
-> Either String (Maybe (Sensitive [ActiveContext]))
-> Either
     String
     (Maybe Text
      -> Maybe [IntentSummary]
      -> Maybe DialogAction
      -> Maybe (Sensitive (HashMap Text Text))
      -> Int
      -> GetSessionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe (Maybe (Sensitive [ActiveContext])))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"activeContexts" Either String (Maybe (Maybe (Sensitive [ActiveContext])))
-> Maybe (Sensitive [ActiveContext])
-> Either String (Maybe (Sensitive [ActiveContext]))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (Sensitive [ActiveContext])
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Maybe [IntentSummary]
   -> Maybe DialogAction
   -> Maybe (Sensitive (HashMap Text Text))
   -> Int
   -> GetSessionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [IntentSummary]
      -> Maybe DialogAction
      -> Maybe (Sensitive (HashMap Text Text))
      -> Int
      -> GetSessionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"sessionId")
            Either
  String
  (Maybe [IntentSummary]
   -> Maybe DialogAction
   -> Maybe (Sensitive (HashMap Text Text))
   -> Int
   -> GetSessionResponse)
-> Either String (Maybe [IntentSummary])
-> Either
     String
     (Maybe DialogAction
      -> Maybe (Sensitive (HashMap Text Text))
      -> Int
      -> GetSessionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [IntentSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"recentIntentSummaryView"
                            Either String (Maybe (Maybe [IntentSummary]))
-> Maybe [IntentSummary] -> Either String (Maybe [IntentSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [IntentSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe DialogAction
   -> Maybe (Sensitive (HashMap Text Text))
   -> Int
   -> GetSessionResponse)
-> Either String (Maybe DialogAction)
-> Either
     String
     (Maybe (Sensitive (HashMap Text Text))
      -> Int -> GetSessionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe DialogAction)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"dialogAction")
            Either
  String
  (Maybe (Sensitive (HashMap Text Text))
   -> Int -> GetSessionResponse)
-> Either String (Maybe (Sensitive (HashMap Text Text)))
-> Either String (Int -> GetSessionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe (Sensitive (HashMap Text Text))))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"sessionAttributes"
                            Either String (Maybe (Maybe (Sensitive (HashMap Text Text))))
-> Maybe (Sensitive (HashMap Text Text))
-> Either String (Maybe (Sensitive (HashMap Text Text)))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (Sensitive (HashMap Text Text))
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> GetSessionResponse)
-> Either String Int -> Either String GetSessionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetSession

instance Prelude.NFData GetSession

instance Core.ToHeaders GetSession where
  toHeaders :: GetSession -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetSession -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath GetSession where
  toPath :: GetSession -> ByteString
toPath GetSession' {Maybe Text
Text
userId :: Text
botAlias :: Text
botName :: Text
checkpointLabelFilter :: Maybe Text
$sel:userId:GetSession' :: GetSession -> Text
$sel:botAlias:GetSession' :: GetSession -> Text
$sel:botName:GetSession' :: GetSession -> Text
$sel:checkpointLabelFilter:GetSession' :: GetSession -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/bot/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
botName,
        ByteString
"/alias/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
botAlias,
        ByteString
"/user/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
userId,
        ByteString
"/session/"
      ]

instance Core.ToQuery GetSession where
  toQuery :: GetSession -> QueryString
toQuery GetSession' {Maybe Text
Text
userId :: Text
botAlias :: Text
botName :: Text
checkpointLabelFilter :: Maybe Text
$sel:userId:GetSession' :: GetSession -> Text
$sel:botAlias:GetSession' :: GetSession -> Text
$sel:botName:GetSession' :: GetSession -> Text
$sel:checkpointLabelFilter:GetSession' :: GetSession -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"checkpointLabelFilter"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
checkpointLabelFilter
      ]

-- | /See:/ 'newGetSessionResponse' smart constructor.
data GetSessionResponse = GetSessionResponse'
  { -- | A list of active contexts for the session. A context can be set when an
    -- intent is fulfilled or by calling the @PostContent@, @PostText@, or
    -- @PutSession@ operation.
    --
    -- You can use a context to control the intents that can follow up an
    -- intent, or to modify the operation of your application.
    GetSessionResponse -> Maybe (Sensitive [ActiveContext])
activeContexts :: Prelude.Maybe (Core.Sensitive [ActiveContext]),
    -- | A unique identifier for the session.
    GetSessionResponse -> Maybe Text
sessionId :: Prelude.Maybe Prelude.Text,
    -- | An array of information about the intents used in the session. The array
    -- can contain a maximum of three summaries. If more than three intents are
    -- used in the session, the @recentIntentSummaryView@ operation contains
    -- information about the last three intents used.
    --
    -- If you set the @checkpointLabelFilter@ parameter in the request, the
    -- array contains only the intents with the specified label.
    GetSessionResponse -> Maybe [IntentSummary]
recentIntentSummaryView :: Prelude.Maybe [IntentSummary],
    -- | Describes the current state of the bot.
    GetSessionResponse -> Maybe DialogAction
dialogAction :: Prelude.Maybe DialogAction,
    -- | Map of key\/value pairs representing the session-specific context
    -- information. It contains application information passed between Amazon
    -- Lex and a client application.
    GetSessionResponse -> Maybe (Sensitive (HashMap Text Text))
sessionAttributes :: Prelude.Maybe (Core.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
    -- | The response's http status code.
    GetSessionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetSessionResponse -> GetSessionResponse -> Bool
(GetSessionResponse -> GetSessionResponse -> Bool)
-> (GetSessionResponse -> GetSessionResponse -> Bool)
-> Eq GetSessionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSessionResponse -> GetSessionResponse -> Bool
$c/= :: GetSessionResponse -> GetSessionResponse -> Bool
== :: GetSessionResponse -> GetSessionResponse -> Bool
$c== :: GetSessionResponse -> GetSessionResponse -> Bool
Prelude.Eq, Int -> GetSessionResponse -> ShowS
[GetSessionResponse] -> ShowS
GetSessionResponse -> String
(Int -> GetSessionResponse -> ShowS)
-> (GetSessionResponse -> String)
-> ([GetSessionResponse] -> ShowS)
-> Show GetSessionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSessionResponse] -> ShowS
$cshowList :: [GetSessionResponse] -> ShowS
show :: GetSessionResponse -> String
$cshow :: GetSessionResponse -> String
showsPrec :: Int -> GetSessionResponse -> ShowS
$cshowsPrec :: Int -> GetSessionResponse -> ShowS
Prelude.Show, (forall x. GetSessionResponse -> Rep GetSessionResponse x)
-> (forall x. Rep GetSessionResponse x -> GetSessionResponse)
-> Generic GetSessionResponse
forall x. Rep GetSessionResponse x -> GetSessionResponse
forall x. GetSessionResponse -> Rep GetSessionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSessionResponse x -> GetSessionResponse
$cfrom :: forall x. GetSessionResponse -> Rep GetSessionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSessionResponse' 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:
--
-- 'activeContexts', 'getSessionResponse_activeContexts' - A list of active contexts for the session. A context can be set when an
-- intent is fulfilled or by calling the @PostContent@, @PostText@, or
-- @PutSession@ operation.
--
-- You can use a context to control the intents that can follow up an
-- intent, or to modify the operation of your application.
--
-- 'sessionId', 'getSessionResponse_sessionId' - A unique identifier for the session.
--
-- 'recentIntentSummaryView', 'getSessionResponse_recentIntentSummaryView' - An array of information about the intents used in the session. The array
-- can contain a maximum of three summaries. If more than three intents are
-- used in the session, the @recentIntentSummaryView@ operation contains
-- information about the last three intents used.
--
-- If you set the @checkpointLabelFilter@ parameter in the request, the
-- array contains only the intents with the specified label.
--
-- 'dialogAction', 'getSessionResponse_dialogAction' - Describes the current state of the bot.
--
-- 'sessionAttributes', 'getSessionResponse_sessionAttributes' - Map of key\/value pairs representing the session-specific context
-- information. It contains application information passed between Amazon
-- Lex and a client application.
--
-- 'httpStatus', 'getSessionResponse_httpStatus' - The response's http status code.
newGetSessionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSessionResponse
newGetSessionResponse :: Int -> GetSessionResponse
newGetSessionResponse Int
pHttpStatus_ =
  GetSessionResponse' :: Maybe (Sensitive [ActiveContext])
-> Maybe Text
-> Maybe [IntentSummary]
-> Maybe DialogAction
-> Maybe (Sensitive (HashMap Text Text))
-> Int
-> GetSessionResponse
GetSessionResponse'
    { $sel:activeContexts:GetSessionResponse' :: Maybe (Sensitive [ActiveContext])
activeContexts =
        Maybe (Sensitive [ActiveContext])
forall a. Maybe a
Prelude.Nothing,
      $sel:sessionId:GetSessionResponse' :: Maybe Text
sessionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recentIntentSummaryView:GetSessionResponse' :: Maybe [IntentSummary]
recentIntentSummaryView = Maybe [IntentSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:dialogAction:GetSessionResponse' :: Maybe DialogAction
dialogAction = Maybe DialogAction
forall a. Maybe a
Prelude.Nothing,
      $sel:sessionAttributes:GetSessionResponse' :: Maybe (Sensitive (HashMap Text Text))
sessionAttributes = Maybe (Sensitive (HashMap Text Text))
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSessionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of active contexts for the session. A context can be set when an
-- intent is fulfilled or by calling the @PostContent@, @PostText@, or
-- @PutSession@ operation.
--
-- You can use a context to control the intents that can follow up an
-- intent, or to modify the operation of your application.
getSessionResponse_activeContexts :: Lens.Lens' GetSessionResponse (Prelude.Maybe [ActiveContext])
getSessionResponse_activeContexts :: (Maybe [ActiveContext] -> f (Maybe [ActiveContext]))
-> GetSessionResponse -> f GetSessionResponse
getSessionResponse_activeContexts = (GetSessionResponse -> Maybe (Sensitive [ActiveContext]))
-> (GetSessionResponse
    -> Maybe (Sensitive [ActiveContext]) -> GetSessionResponse)
-> Lens
     GetSessionResponse
     GetSessionResponse
     (Maybe (Sensitive [ActiveContext]))
     (Maybe (Sensitive [ActiveContext]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionResponse' {Maybe (Sensitive [ActiveContext])
activeContexts :: Maybe (Sensitive [ActiveContext])
$sel:activeContexts:GetSessionResponse' :: GetSessionResponse -> Maybe (Sensitive [ActiveContext])
activeContexts} -> Maybe (Sensitive [ActiveContext])
activeContexts) (\s :: GetSessionResponse
s@GetSessionResponse' {} Maybe (Sensitive [ActiveContext])
a -> GetSessionResponse
s {$sel:activeContexts:GetSessionResponse' :: Maybe (Sensitive [ActiveContext])
activeContexts = Maybe (Sensitive [ActiveContext])
a} :: GetSessionResponse) ((Maybe (Sensitive [ActiveContext])
  -> f (Maybe (Sensitive [ActiveContext])))
 -> GetSessionResponse -> f GetSessionResponse)
-> ((Maybe [ActiveContext] -> f (Maybe [ActiveContext]))
    -> Maybe (Sensitive [ActiveContext])
    -> f (Maybe (Sensitive [ActiveContext])))
-> (Maybe [ActiveContext] -> f (Maybe [ActiveContext]))
-> GetSessionResponse
-> f GetSessionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (Sensitive [ActiveContext])
  (Sensitive [ActiveContext])
  [ActiveContext]
  [ActiveContext]
-> Iso
     (Maybe (Sensitive [ActiveContext]))
     (Maybe (Sensitive [ActiveContext]))
     (Maybe [ActiveContext])
     (Maybe [ActiveContext])
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 [ActiveContext])
  (Sensitive [ActiveContext])
  [ActiveContext]
  [ActiveContext]
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso
  (Sensitive [ActiveContext])
  (Sensitive [ActiveContext])
  [ActiveContext]
  [ActiveContext]
-> (Exchange
      [ActiveContext]
      [ActiveContext]
      [ActiveContext]
      (Identity [ActiveContext])
    -> Exchange
         [ActiveContext]
         [ActiveContext]
         [ActiveContext]
         (Identity [ActiveContext]))
-> AnIso
     (Sensitive [ActiveContext])
     (Sensitive [ActiveContext])
     [ActiveContext]
     [ActiveContext]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
  [ActiveContext]
  [ActiveContext]
  [ActiveContext]
  (Identity [ActiveContext])
-> Exchange
     [ActiveContext]
     [ActiveContext]
     [ActiveContext]
     (Identity [ActiveContext])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | A unique identifier for the session.
getSessionResponse_sessionId :: Lens.Lens' GetSessionResponse (Prelude.Maybe Prelude.Text)
getSessionResponse_sessionId :: (Maybe Text -> f (Maybe Text))
-> GetSessionResponse -> f GetSessionResponse
getSessionResponse_sessionId = (GetSessionResponse -> Maybe Text)
-> (GetSessionResponse -> Maybe Text -> GetSessionResponse)
-> Lens
     GetSessionResponse GetSessionResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionResponse' {Maybe Text
sessionId :: Maybe Text
$sel:sessionId:GetSessionResponse' :: GetSessionResponse -> Maybe Text
sessionId} -> Maybe Text
sessionId) (\s :: GetSessionResponse
s@GetSessionResponse' {} Maybe Text
a -> GetSessionResponse
s {$sel:sessionId:GetSessionResponse' :: Maybe Text
sessionId = Maybe Text
a} :: GetSessionResponse)

-- | An array of information about the intents used in the session. The array
-- can contain a maximum of three summaries. If more than three intents are
-- used in the session, the @recentIntentSummaryView@ operation contains
-- information about the last three intents used.
--
-- If you set the @checkpointLabelFilter@ parameter in the request, the
-- array contains only the intents with the specified label.
getSessionResponse_recentIntentSummaryView :: Lens.Lens' GetSessionResponse (Prelude.Maybe [IntentSummary])
getSessionResponse_recentIntentSummaryView :: (Maybe [IntentSummary] -> f (Maybe [IntentSummary]))
-> GetSessionResponse -> f GetSessionResponse
getSessionResponse_recentIntentSummaryView = (GetSessionResponse -> Maybe [IntentSummary])
-> (GetSessionResponse
    -> Maybe [IntentSummary] -> GetSessionResponse)
-> Lens
     GetSessionResponse
     GetSessionResponse
     (Maybe [IntentSummary])
     (Maybe [IntentSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionResponse' {Maybe [IntentSummary]
recentIntentSummaryView :: Maybe [IntentSummary]
$sel:recentIntentSummaryView:GetSessionResponse' :: GetSessionResponse -> Maybe [IntentSummary]
recentIntentSummaryView} -> Maybe [IntentSummary]
recentIntentSummaryView) (\s :: GetSessionResponse
s@GetSessionResponse' {} Maybe [IntentSummary]
a -> GetSessionResponse
s {$sel:recentIntentSummaryView:GetSessionResponse' :: Maybe [IntentSummary]
recentIntentSummaryView = Maybe [IntentSummary]
a} :: GetSessionResponse) ((Maybe [IntentSummary] -> f (Maybe [IntentSummary]))
 -> GetSessionResponse -> f GetSessionResponse)
-> ((Maybe [IntentSummary] -> f (Maybe [IntentSummary]))
    -> Maybe [IntentSummary] -> f (Maybe [IntentSummary]))
-> (Maybe [IntentSummary] -> f (Maybe [IntentSummary]))
-> GetSessionResponse
-> f GetSessionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [IntentSummary] [IntentSummary] [IntentSummary] [IntentSummary]
-> Iso
     (Maybe [IntentSummary])
     (Maybe [IntentSummary])
     (Maybe [IntentSummary])
     (Maybe [IntentSummary])
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
  [IntentSummary] [IntentSummary] [IntentSummary] [IntentSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Describes the current state of the bot.
getSessionResponse_dialogAction :: Lens.Lens' GetSessionResponse (Prelude.Maybe DialogAction)
getSessionResponse_dialogAction :: (Maybe DialogAction -> f (Maybe DialogAction))
-> GetSessionResponse -> f GetSessionResponse
getSessionResponse_dialogAction = (GetSessionResponse -> Maybe DialogAction)
-> (GetSessionResponse -> Maybe DialogAction -> GetSessionResponse)
-> Lens
     GetSessionResponse
     GetSessionResponse
     (Maybe DialogAction)
     (Maybe DialogAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionResponse' {Maybe DialogAction
dialogAction :: Maybe DialogAction
$sel:dialogAction:GetSessionResponse' :: GetSessionResponse -> Maybe DialogAction
dialogAction} -> Maybe DialogAction
dialogAction) (\s :: GetSessionResponse
s@GetSessionResponse' {} Maybe DialogAction
a -> GetSessionResponse
s {$sel:dialogAction:GetSessionResponse' :: Maybe DialogAction
dialogAction = Maybe DialogAction
a} :: GetSessionResponse)

-- | Map of key\/value pairs representing the session-specific context
-- information. It contains application information passed between Amazon
-- Lex and a client application.
getSessionResponse_sessionAttributes :: Lens.Lens' GetSessionResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getSessionResponse_sessionAttributes :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetSessionResponse -> f GetSessionResponse
getSessionResponse_sessionAttributes = (GetSessionResponse -> Maybe (Sensitive (HashMap Text Text)))
-> (GetSessionResponse
    -> Maybe (Sensitive (HashMap Text Text)) -> GetSessionResponse)
-> Lens
     GetSessionResponse
     GetSessionResponse
     (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 (\GetSessionResponse' {Maybe (Sensitive (HashMap Text Text))
sessionAttributes :: Maybe (Sensitive (HashMap Text Text))
$sel:sessionAttributes:GetSessionResponse' :: GetSessionResponse -> Maybe (Sensitive (HashMap Text Text))
sessionAttributes} -> Maybe (Sensitive (HashMap Text Text))
sessionAttributes) (\s :: GetSessionResponse
s@GetSessionResponse' {} Maybe (Sensitive (HashMap Text Text))
a -> GetSessionResponse
s {$sel:sessionAttributes:GetSessionResponse' :: Maybe (Sensitive (HashMap Text Text))
sessionAttributes = Maybe (Sensitive (HashMap Text Text))
a} :: GetSessionResponse) ((Maybe (Sensitive (HashMap Text Text))
  -> f (Maybe (Sensitive (HashMap Text Text))))
 -> GetSessionResponse -> f GetSessionResponse)
-> ((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)))
-> GetSessionResponse
-> f GetSessionResponse
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)

-- | The response's http status code.
getSessionResponse_httpStatus :: Lens.Lens' GetSessionResponse Prelude.Int
getSessionResponse_httpStatus :: (Int -> f Int) -> GetSessionResponse -> f GetSessionResponse
getSessionResponse_httpStatus = (GetSessionResponse -> Int)
-> (GetSessionResponse -> Int -> GetSessionResponse)
-> Lens GetSessionResponse GetSessionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSessionResponse' :: GetSessionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSessionResponse
s@GetSessionResponse' {} Int
a -> GetSessionResponse
s {$sel:httpStatus:GetSessionResponse' :: Int
httpStatus = Int
a} :: GetSessionResponse)

instance Prelude.NFData GetSessionResponse