{-# 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.Wisdom.Types.SessionSummary
-- 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)
module Amazonka.Wisdom.Types.SessionSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Summary information about the session.
--
-- /See:/ 'newSessionSummary' smart constructor.
data SessionSummary = SessionSummary'
  { -- | The Amazon Resource Name (ARN) of the Wisdom assistant
    SessionSummary -> Text
assistantArn :: Prelude.Text,
    -- | The identifier of the Wisdom assistant.
    SessionSummary -> Text
assistantId :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the session.
    SessionSummary -> Text
sessionArn :: Prelude.Text,
    -- | The identifier of the session.
    SessionSummary -> Text
sessionId :: Prelude.Text
  }
  deriving (SessionSummary -> SessionSummary -> Bool
(SessionSummary -> SessionSummary -> Bool)
-> (SessionSummary -> SessionSummary -> Bool) -> Eq SessionSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SessionSummary -> SessionSummary -> Bool
$c/= :: SessionSummary -> SessionSummary -> Bool
== :: SessionSummary -> SessionSummary -> Bool
$c== :: SessionSummary -> SessionSummary -> Bool
Prelude.Eq, ReadPrec [SessionSummary]
ReadPrec SessionSummary
Int -> ReadS SessionSummary
ReadS [SessionSummary]
(Int -> ReadS SessionSummary)
-> ReadS [SessionSummary]
-> ReadPrec SessionSummary
-> ReadPrec [SessionSummary]
-> Read SessionSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SessionSummary]
$creadListPrec :: ReadPrec [SessionSummary]
readPrec :: ReadPrec SessionSummary
$creadPrec :: ReadPrec SessionSummary
readList :: ReadS [SessionSummary]
$creadList :: ReadS [SessionSummary]
readsPrec :: Int -> ReadS SessionSummary
$creadsPrec :: Int -> ReadS SessionSummary
Prelude.Read, Int -> SessionSummary -> ShowS
[SessionSummary] -> ShowS
SessionSummary -> String
(Int -> SessionSummary -> ShowS)
-> (SessionSummary -> String)
-> ([SessionSummary] -> ShowS)
-> Show SessionSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SessionSummary] -> ShowS
$cshowList :: [SessionSummary] -> ShowS
show :: SessionSummary -> String
$cshow :: SessionSummary -> String
showsPrec :: Int -> SessionSummary -> ShowS
$cshowsPrec :: Int -> SessionSummary -> ShowS
Prelude.Show, (forall x. SessionSummary -> Rep SessionSummary x)
-> (forall x. Rep SessionSummary x -> SessionSummary)
-> Generic SessionSummary
forall x. Rep SessionSummary x -> SessionSummary
forall x. SessionSummary -> Rep SessionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SessionSummary x -> SessionSummary
$cfrom :: forall x. SessionSummary -> Rep SessionSummary x
Prelude.Generic)

-- |
-- Create a value of 'SessionSummary' 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:
--
-- 'assistantArn', 'sessionSummary_assistantArn' - The Amazon Resource Name (ARN) of the Wisdom assistant
--
-- 'assistantId', 'sessionSummary_assistantId' - The identifier of the Wisdom assistant.
--
-- 'sessionArn', 'sessionSummary_sessionArn' - The Amazon Resource Name (ARN) of the session.
--
-- 'sessionId', 'sessionSummary_sessionId' - The identifier of the session.
newSessionSummary ::
  -- | 'assistantArn'
  Prelude.Text ->
  -- | 'assistantId'
  Prelude.Text ->
  -- | 'sessionArn'
  Prelude.Text ->
  -- | 'sessionId'
  Prelude.Text ->
  SessionSummary
newSessionSummary :: Text -> Text -> Text -> Text -> SessionSummary
newSessionSummary
  Text
pAssistantArn_
  Text
pAssistantId_
  Text
pSessionArn_
  Text
pSessionId_ =
    SessionSummary' :: Text -> Text -> Text -> Text -> SessionSummary
SessionSummary'
      { $sel:assistantArn:SessionSummary' :: Text
assistantArn = Text
pAssistantArn_,
        $sel:assistantId:SessionSummary' :: Text
assistantId = Text
pAssistantId_,
        $sel:sessionArn:SessionSummary' :: Text
sessionArn = Text
pSessionArn_,
        $sel:sessionId:SessionSummary' :: Text
sessionId = Text
pSessionId_
      }

-- | The Amazon Resource Name (ARN) of the Wisdom assistant
sessionSummary_assistantArn :: Lens.Lens' SessionSummary Prelude.Text
sessionSummary_assistantArn :: (Text -> f Text) -> SessionSummary -> f SessionSummary
sessionSummary_assistantArn = (SessionSummary -> Text)
-> (SessionSummary -> Text -> SessionSummary)
-> Lens SessionSummary SessionSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionSummary' {Text
assistantArn :: Text
$sel:assistantArn:SessionSummary' :: SessionSummary -> Text
assistantArn} -> Text
assistantArn) (\s :: SessionSummary
s@SessionSummary' {} Text
a -> SessionSummary
s {$sel:assistantArn:SessionSummary' :: Text
assistantArn = Text
a} :: SessionSummary)

-- | The identifier of the Wisdom assistant.
sessionSummary_assistantId :: Lens.Lens' SessionSummary Prelude.Text
sessionSummary_assistantId :: (Text -> f Text) -> SessionSummary -> f SessionSummary
sessionSummary_assistantId = (SessionSummary -> Text)
-> (SessionSummary -> Text -> SessionSummary)
-> Lens SessionSummary SessionSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionSummary' {Text
assistantId :: Text
$sel:assistantId:SessionSummary' :: SessionSummary -> Text
assistantId} -> Text
assistantId) (\s :: SessionSummary
s@SessionSummary' {} Text
a -> SessionSummary
s {$sel:assistantId:SessionSummary' :: Text
assistantId = Text
a} :: SessionSummary)

-- | The Amazon Resource Name (ARN) of the session.
sessionSummary_sessionArn :: Lens.Lens' SessionSummary Prelude.Text
sessionSummary_sessionArn :: (Text -> f Text) -> SessionSummary -> f SessionSummary
sessionSummary_sessionArn = (SessionSummary -> Text)
-> (SessionSummary -> Text -> SessionSummary)
-> Lens SessionSummary SessionSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionSummary' {Text
sessionArn :: Text
$sel:sessionArn:SessionSummary' :: SessionSummary -> Text
sessionArn} -> Text
sessionArn) (\s :: SessionSummary
s@SessionSummary' {} Text
a -> SessionSummary
s {$sel:sessionArn:SessionSummary' :: Text
sessionArn = Text
a} :: SessionSummary)

-- | The identifier of the session.
sessionSummary_sessionId :: Lens.Lens' SessionSummary Prelude.Text
sessionSummary_sessionId :: (Text -> f Text) -> SessionSummary -> f SessionSummary
sessionSummary_sessionId = (SessionSummary -> Text)
-> (SessionSummary -> Text -> SessionSummary)
-> Lens SessionSummary SessionSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionSummary' {Text
sessionId :: Text
$sel:sessionId:SessionSummary' :: SessionSummary -> Text
sessionId} -> Text
sessionId) (\s :: SessionSummary
s@SessionSummary' {} Text
a -> SessionSummary
s {$sel:sessionId:SessionSummary' :: Text
sessionId = Text
a} :: SessionSummary)

instance Core.FromJSON SessionSummary where
  parseJSON :: Value -> Parser SessionSummary
parseJSON =
    String
-> (Object -> Parser SessionSummary)
-> Value
-> Parser SessionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SessionSummary"
      ( \Object
x ->
          Text -> Text -> Text -> Text -> SessionSummary
SessionSummary'
            (Text -> Text -> Text -> Text -> SessionSummary)
-> Parser Text -> Parser (Text -> Text -> Text -> SessionSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"assistantArn")
            Parser (Text -> Text -> Text -> SessionSummary)
-> Parser Text -> Parser (Text -> Text -> SessionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"assistantId")
            Parser (Text -> Text -> SessionSummary)
-> Parser Text -> Parser (Text -> SessionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"sessionArn")
            Parser (Text -> SessionSummary)
-> Parser Text -> Parser SessionSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"sessionId")
      )

instance Prelude.Hashable SessionSummary

instance Prelude.NFData SessionSummary