{-# 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 #-}
module Amazonka.Wisdom.Types.SessionData where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SessionData = SessionData'
{
SessionData -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
SessionData -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
SessionData -> Text
name :: Prelude.Text,
SessionData -> Text
sessionArn :: Prelude.Text,
SessionData -> Text
sessionId :: Prelude.Text
}
deriving (SessionData -> SessionData -> Bool
(SessionData -> SessionData -> Bool)
-> (SessionData -> SessionData -> Bool) -> Eq SessionData
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]
(Int -> ReadS SessionData)
-> ReadS [SessionData]
-> ReadPrec SessionData
-> ReadPrec [SessionData]
-> Read 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
(Int -> SessionData -> ShowS)
-> (SessionData -> String)
-> ([SessionData] -> ShowS)
-> Show SessionData
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. SessionData -> Rep SessionData x)
-> (forall x. Rep SessionData x -> SessionData)
-> Generic SessionData
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)
newSessionData ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
SessionData
newSessionData :: Text -> Text -> Text -> SessionData
newSessionData Text
pName_ Text
pSessionArn_ Text
pSessionId_ =
SessionData' :: Maybe Text
-> Maybe (HashMap Text Text) -> Text -> Text -> Text -> SessionData
SessionData'
{ $sel:description:SessionData' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:SessionData' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
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_
}
sessionData_description :: Lens.Lens' SessionData (Prelude.Maybe Prelude.Text)
sessionData_description :: (Maybe Text -> f (Maybe Text)) -> SessionData -> f SessionData
sessionData_description = (SessionData -> Maybe Text)
-> (SessionData -> Maybe Text -> SessionData)
-> Lens SessionData SessionData (Maybe Text) (Maybe Text)
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)
sessionData_tags :: Lens.Lens' SessionData (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
sessionData_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SessionData -> f SessionData
sessionData_tags = (SessionData -> Maybe (HashMap Text Text))
-> (SessionData -> Maybe (HashMap Text Text) -> SessionData)
-> Lens
SessionData
SessionData
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SessionData -> f SessionData)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SessionData
-> f SessionData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
sessionData_name :: Lens.Lens' SessionData Prelude.Text
sessionData_name :: (Text -> f Text) -> SessionData -> f SessionData
sessionData_name = (SessionData -> Text)
-> (SessionData -> Text -> SessionData)
-> Lens SessionData SessionData Text Text
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)
sessionData_sessionArn :: Lens.Lens' SessionData Prelude.Text
sessionData_sessionArn :: (Text -> f Text) -> SessionData -> f SessionData
sessionData_sessionArn = (SessionData -> Text)
-> (SessionData -> Text -> SessionData)
-> Lens SessionData SessionData Text Text
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)
sessionData_sessionId :: Lens.Lens' SessionData Prelude.Text
sessionData_sessionId :: (Text -> f Text) -> SessionData -> f SessionData
sessionData_sessionId = (SessionData -> Text)
-> (SessionData -> Text -> SessionData)
-> Lens SessionData SessionData Text Text
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 Core.FromJSON SessionData where
parseJSON :: Value -> Parser SessionData
parseJSON =
String
-> (Object -> Parser SessionData) -> Value -> Parser SessionData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SessionData"
( \Object
x ->
Maybe Text
-> Maybe (HashMap Text Text) -> Text -> Text -> Text -> SessionData
SessionData'
(Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> SessionData)
-> Parser (Maybe Text)
-> Parser
(Maybe (HashMap Text Text) -> Text -> Text -> Text -> SessionData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
Parser
(Maybe (HashMap Text Text) -> Text -> Text -> Text -> SessionData)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Text -> Text -> Text -> SessionData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> Text -> Text -> SessionData)
-> Parser Text -> Parser (Text -> Text -> SessionData)
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
"name")
Parser (Text -> Text -> SessionData)
-> Parser Text -> Parser (Text -> SessionData)
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 -> SessionData) -> Parser Text -> Parser SessionData
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 SessionData
instance Prelude.NFData SessionData