{-# 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.SessionData
-- 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.Wisdom.Types.SessionData where

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

-- | Information about the session.
--
-- /See:/ 'newSessionData' smart constructor.
data SessionData = SessionData'
  { -- | The description of the session.
    SessionData -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags used to organize, track, or control access for this resource.
    SessionData -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the session.
    SessionData -> Text
name :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the session.
    SessionData -> Text
sessionArn :: Prelude.Text,
    -- | The identifier of the session.
    SessionData -> Text
sessionId :: Prelude.Text
  }
  deriving (SessionData -> SessionData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SessionData -> SessionData -> Bool
$c/= :: SessionData -> SessionData -> Bool
== :: SessionData -> SessionData -> Bool
$c== :: SessionData -> SessionData -> Bool
Prelude.Eq, ReadPrec [SessionData]
ReadPrec SessionData
Int -> ReadS SessionData
ReadS [SessionData]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SessionData]
$creadListPrec :: ReadPrec [SessionData]
readPrec :: ReadPrec SessionData
$creadPrec :: ReadPrec SessionData
readList :: ReadS [SessionData]
$creadList :: ReadS [SessionData]
readsPrec :: Int -> ReadS SessionData
$creadsPrec :: Int -> ReadS SessionData
Prelude.Read, Int -> SessionData -> ShowS
[SessionData] -> ShowS
SessionData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SessionData] -> ShowS
$cshowList :: [SessionData] -> ShowS
show :: SessionData -> String
$cshow :: SessionData -> String
showsPrec :: Int -> SessionData -> ShowS
$cshowsPrec :: Int -> SessionData -> ShowS
Prelude.Show, forall x. Rep SessionData x -> SessionData
forall x. SessionData -> Rep SessionData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SessionData x -> SessionData
$cfrom :: forall x. SessionData -> Rep SessionData x
Prelude.Generic)

-- |
-- Create a value of 'SessionData' 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', 'sessionData_description' - The description of the session.
--
-- 'tags', 'sessionData_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'name', 'sessionData_name' - The name of the session.
--
-- 'sessionArn', 'sessionData_sessionArn' - The Amazon Resource Name (ARN) of the session.
--
-- 'sessionId', 'sessionData_sessionId' - The identifier of the session.
newSessionData ::
  -- | 'name'
  Prelude.Text ->
  -- | 'sessionArn'
  Prelude.Text ->
  -- | 'sessionId'
  Prelude.Text ->
  SessionData
newSessionData :: Text -> Text -> Text -> SessionData
newSessionData Text
pName_ Text
pSessionArn_ Text
pSessionId_ =
  SessionData'
    { $sel:description:SessionData' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:SessionData' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:name:SessionData' :: Text
name = Text
pName_,
      $sel:sessionArn:SessionData' :: Text
sessionArn = Text
pSessionArn_,
      $sel:sessionId:SessionData' :: Text
sessionId = Text
pSessionId_
    }

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

-- | The tags used to organize, track, or control access for this resource.
sessionData_tags :: Lens.Lens' SessionData (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
sessionData_tags :: Lens' SessionData (Maybe (HashMap Text Text))
sessionData_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionData' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:SessionData' :: SessionData -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: SessionData
s@SessionData' {} Maybe (HashMap Text Text)
a -> SessionData
s {$sel:tags:SessionData' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: SessionData) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the session.
sessionData_name :: Lens.Lens' SessionData Prelude.Text
sessionData_name :: Lens' SessionData Text
sessionData_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionData' {Text
name :: Text
$sel:name:SessionData' :: SessionData -> Text
name} -> Text
name) (\s :: SessionData
s@SessionData' {} Text
a -> SessionData
s {$sel:name:SessionData' :: Text
name = Text
a} :: SessionData)

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

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

instance Data.FromJSON SessionData where
  parseJSON :: Value -> Parser SessionData
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SessionData"
      ( \Object
x ->
          Maybe Text
-> Maybe (HashMap Text Text) -> Text -> Text -> Text -> SessionData
SessionData'
            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
"tags" 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
"name")
            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
"sessionArn")
            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
"sessionId")
      )

instance Prelude.Hashable SessionData where
  hashWithSalt :: Int -> SessionData -> Int
hashWithSalt Int
_salt SessionData' {Maybe Text
Maybe (HashMap Text Text)
Text
sessionId :: Text
sessionArn :: Text
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:sessionId:SessionData' :: SessionData -> Text
$sel:sessionArn:SessionData' :: SessionData -> Text
$sel:name:SessionData' :: SessionData -> Text
$sel:tags:SessionData' :: SessionData -> Maybe (HashMap Text Text)
$sel:description:SessionData' :: SessionData -> 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 (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sessionArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sessionId

instance Prelude.NFData SessionData where
  rnf :: SessionData -> ()
rnf SessionData' {Maybe Text
Maybe (HashMap Text Text)
Text
sessionId :: Text
sessionArn :: Text
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:sessionId:SessionData' :: SessionData -> Text
$sel:sessionArn:SessionData' :: SessionData -> Text
$sel:name:SessionData' :: SessionData -> Text
$sel:tags:SessionData' :: SessionData -> Maybe (HashMap Text Text)
$sel:description:SessionData' :: SessionData -> 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 (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sessionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sessionId