{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data SessionTag = SessionTag'
{
SessionTag -> Text
key :: Prelude.Text,
SessionTag -> Sensitive Text
value :: Data.Sensitive Prelude.Text
}
deriving (SessionTag -> SessionTag -> Bool
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
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. 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'
{ $sel:key:SessionTag' :: Text
key = Text
pKey_,
$sel:value:SessionTag' :: Sensitive Text
value = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pValue_
}
sessionTag_key :: Lens.Lens' SessionTag Prelude.Text
sessionTag_key :: Lens' SessionTag Text
sessionTag_key = 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 :: Lens' SessionTag Text
sessionTag_value = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Prelude.Hashable SessionTag where
hashWithSalt :: Int -> SessionTag -> Int
hashWithSalt Int
_salt SessionTag' {Text
Sensitive Text
value :: Sensitive Text
key :: Text
$sel:value:SessionTag' :: SessionTag -> Sensitive Text
$sel:key:SessionTag' :: SessionTag -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
value
instance Prelude.NFData SessionTag where
rnf :: SessionTag -> ()
rnf SessionTag' {Text
Sensitive Text
value :: Sensitive Text
key :: Text
$sel:value:SessionTag' :: SessionTag -> Sensitive Text
$sel:key:SessionTag' :: SessionTag -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
key seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
value
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Key" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
key),
forall a. a -> Maybe a
Prelude.Just (Key
"Value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
value)
]
)