{-# 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.Athena.Types.SessionSummary
-- 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.Athena.Types.SessionSummary where

import Amazonka.Athena.Types.EngineVersion
import Amazonka.Athena.Types.SessionStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Contains summary information about a notebook session.
--
-- /See:/ 'newSessionSummary' smart constructor.
data SessionSummary = SessionSummary'
  { -- | The session description.
    SessionSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The engine version used by the session (for example,
    -- @PySpark engine version 3@).
    SessionSummary -> Maybe EngineVersion
engineVersion :: Prelude.Maybe EngineVersion,
    -- | The notebook version.
    SessionSummary -> Maybe Text
notebookVersion :: Prelude.Maybe Prelude.Text,
    -- | The session ID.
    SessionSummary -> Maybe Text
sessionId :: Prelude.Maybe Prelude.Text,
    -- | Contains information about the session status.
    SessionSummary -> Maybe SessionStatus
status :: Prelude.Maybe SessionStatus
  }
  deriving (SessionSummary -> SessionSummary -> Bool
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]
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
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. 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:
--
-- 'description', 'sessionSummary_description' - The session description.
--
-- 'engineVersion', 'sessionSummary_engineVersion' - The engine version used by the session (for example,
-- @PySpark engine version 3@).
--
-- 'notebookVersion', 'sessionSummary_notebookVersion' - The notebook version.
--
-- 'sessionId', 'sessionSummary_sessionId' - The session ID.
--
-- 'status', 'sessionSummary_status' - Contains information about the session status.
newSessionSummary ::
  SessionSummary
newSessionSummary :: SessionSummary
newSessionSummary =
  SessionSummary'
    { $sel:description:SessionSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:engineVersion:SessionSummary' :: Maybe EngineVersion
engineVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:notebookVersion:SessionSummary' :: Maybe Text
notebookVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:sessionId:SessionSummary' :: Maybe Text
sessionId = forall a. Maybe a
Prelude.Nothing,
      $sel:status:SessionSummary' :: Maybe SessionStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The session description.
sessionSummary_description :: Lens.Lens' SessionSummary (Prelude.Maybe Prelude.Text)
sessionSummary_description :: Lens' SessionSummary (Maybe Text)
sessionSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionSummary' {Maybe Text
description :: Maybe Text
$sel:description:SessionSummary' :: SessionSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: SessionSummary
s@SessionSummary' {} Maybe Text
a -> SessionSummary
s {$sel:description:SessionSummary' :: Maybe Text
description = Maybe Text
a} :: SessionSummary)

-- | The engine version used by the session (for example,
-- @PySpark engine version 3@).
sessionSummary_engineVersion :: Lens.Lens' SessionSummary (Prelude.Maybe EngineVersion)
sessionSummary_engineVersion :: Lens' SessionSummary (Maybe EngineVersion)
sessionSummary_engineVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionSummary' {Maybe EngineVersion
engineVersion :: Maybe EngineVersion
$sel:engineVersion:SessionSummary' :: SessionSummary -> Maybe EngineVersion
engineVersion} -> Maybe EngineVersion
engineVersion) (\s :: SessionSummary
s@SessionSummary' {} Maybe EngineVersion
a -> SessionSummary
s {$sel:engineVersion:SessionSummary' :: Maybe EngineVersion
engineVersion = Maybe EngineVersion
a} :: SessionSummary)

-- | The notebook version.
sessionSummary_notebookVersion :: Lens.Lens' SessionSummary (Prelude.Maybe Prelude.Text)
sessionSummary_notebookVersion :: Lens' SessionSummary (Maybe Text)
sessionSummary_notebookVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionSummary' {Maybe Text
notebookVersion :: Maybe Text
$sel:notebookVersion:SessionSummary' :: SessionSummary -> Maybe Text
notebookVersion} -> Maybe Text
notebookVersion) (\s :: SessionSummary
s@SessionSummary' {} Maybe Text
a -> SessionSummary
s {$sel:notebookVersion:SessionSummary' :: Maybe Text
notebookVersion = Maybe Text
a} :: SessionSummary)

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

-- | Contains information about the session status.
sessionSummary_status :: Lens.Lens' SessionSummary (Prelude.Maybe SessionStatus)
sessionSummary_status :: Lens' SessionSummary (Maybe SessionStatus)
sessionSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionSummary' {Maybe SessionStatus
status :: Maybe SessionStatus
$sel:status:SessionSummary' :: SessionSummary -> Maybe SessionStatus
status} -> Maybe SessionStatus
status) (\s :: SessionSummary
s@SessionSummary' {} Maybe SessionStatus
a -> SessionSummary
s {$sel:status:SessionSummary' :: Maybe SessionStatus
status = Maybe SessionStatus
a} :: SessionSummary)

instance Data.FromJSON SessionSummary where
  parseJSON :: Value -> Parser SessionSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SessionSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe EngineVersion
-> Maybe Text
-> Maybe Text
-> Maybe SessionStatus
-> SessionSummary
SessionSummary'
            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
"Description")
            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
"EngineVersion")
            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
"NotebookVersion")
            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
"SessionId")
            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
"Status")
      )

instance Prelude.Hashable SessionSummary where
  hashWithSalt :: Int -> SessionSummary -> Int
hashWithSalt Int
_salt SessionSummary' {Maybe Text
Maybe EngineVersion
Maybe SessionStatus
status :: Maybe SessionStatus
sessionId :: Maybe Text
notebookVersion :: Maybe Text
engineVersion :: Maybe EngineVersion
description :: Maybe Text
$sel:status:SessionSummary' :: SessionSummary -> Maybe SessionStatus
$sel:sessionId:SessionSummary' :: SessionSummary -> Maybe Text
$sel:notebookVersion:SessionSummary' :: SessionSummary -> Maybe Text
$sel:engineVersion:SessionSummary' :: SessionSummary -> Maybe EngineVersion
$sel:description:SessionSummary' :: SessionSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EngineVersion
engineVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notebookVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sessionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SessionStatus
status

instance Prelude.NFData SessionSummary where
  rnf :: SessionSummary -> ()
rnf SessionSummary' {Maybe Text
Maybe EngineVersion
Maybe SessionStatus
status :: Maybe SessionStatus
sessionId :: Maybe Text
notebookVersion :: Maybe Text
engineVersion :: Maybe EngineVersion
description :: Maybe Text
$sel:status:SessionSummary' :: SessionSummary -> Maybe SessionStatus
$sel:sessionId:SessionSummary' :: SessionSummary -> Maybe Text
$sel:notebookVersion:SessionSummary' :: SessionSummary -> Maybe Text
$sel:engineVersion:SessionSummary' :: SessionSummary -> Maybe EngineVersion
$sel:description:SessionSummary' :: SessionSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EngineVersion
engineVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notebookVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sessionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SessionStatus
status