{-# 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.QuickSight.Types.SessionTag where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SessionTag = SessionTag'
{
SessionTag -> Text
key :: Prelude.Text,
SessionTag -> Sensitive Text
value :: Core.Sensitive Prelude.Text
}
deriving (SessionTag -> SessionTag -> Bool
(SessionTag -> SessionTag -> Bool)
-> (SessionTag -> SessionTag -> Bool) -> Eq SessionTag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SessionTag -> SessionTag -> Bool
$c/= :: SessionTag -> SessionTag -> Bool
== :: SessionTag -> SessionTag -> Bool
$c== :: SessionTag -> SessionTag -> Bool
Prelude.Eq, Int -> SessionTag -> ShowS
[SessionTag] -> ShowS
SessionTag -> String
(Int -> SessionTag -> ShowS)
-> (SessionTag -> String)
-> ([SessionTag] -> ShowS)
-> Show SessionTag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SessionTag] -> ShowS
$cshowList :: [SessionTag] -> ShowS
show :: SessionTag -> String
$cshow :: SessionTag -> String
showsPrec :: Int -> SessionTag -> ShowS
$cshowsPrec :: Int -> SessionTag -> ShowS
Prelude.Show, (forall x. SessionTag -> Rep SessionTag x)
-> (forall x. Rep SessionTag x -> SessionTag) -> Generic SessionTag
forall x. Rep SessionTag x -> SessionTag
forall x. SessionTag -> Rep SessionTag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SessionTag x -> SessionTag
$cfrom :: forall x. SessionTag -> Rep SessionTag x
Prelude.Generic)
newSessionTag ::
Prelude.Text ->
Prelude.Text ->
SessionTag
newSessionTag :: Text -> Text -> SessionTag
newSessionTag Text
pKey_ Text
pValue_ =
SessionTag' :: Text -> Sensitive Text -> SessionTag
SessionTag'
{ $sel:key:SessionTag' :: Text
key = Text
pKey_,
$sel:value:SessionTag' :: Sensitive Text
value = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pValue_
}
sessionTag_key :: Lens.Lens' SessionTag Prelude.Text
sessionTag_key :: (Text -> f Text) -> SessionTag -> f SessionTag
sessionTag_key = (SessionTag -> Text)
-> (SessionTag -> Text -> SessionTag)
-> Lens SessionTag SessionTag Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionTag' {Text
key :: Text
$sel:key:SessionTag' :: SessionTag -> Text
key} -> Text
key) (\s :: SessionTag
s@SessionTag' {} Text
a -> SessionTag
s {$sel:key:SessionTag' :: Text
key = Text
a} :: SessionTag)
sessionTag_value :: Lens.Lens' SessionTag Prelude.Text
sessionTag_value :: (Text -> f Text) -> SessionTag -> f SessionTag
sessionTag_value = (SessionTag -> Sensitive Text)
-> (SessionTag -> Sensitive Text -> SessionTag)
-> Lens SessionTag SessionTag (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionTag' {Sensitive Text
value :: Sensitive Text
$sel:value:SessionTag' :: SessionTag -> Sensitive Text
value} -> Sensitive Text
value) (\s :: SessionTag
s@SessionTag' {} Sensitive Text
a -> SessionTag
s {$sel:value:SessionTag' :: Sensitive Text
value = Sensitive Text
a} :: SessionTag) ((Sensitive Text -> f (Sensitive Text))
-> SessionTag -> f SessionTag)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SessionTag
-> f SessionTag
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Prelude.Hashable SessionTag
instance Prelude.NFData SessionTag
instance Core.ToJSON SessionTag where
toJSON :: SessionTag -> Value
toJSON SessionTag' {Text
Sensitive Text
value :: Sensitive Text
key :: Text
$sel:value:SessionTag' :: SessionTag -> Sensitive Text
$sel:key:SessionTag' :: SessionTag -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Key" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
key),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Value" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
value)
]
)