{-# 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.ChimeSDKIdentity.Types.Tag where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Tag = Tag'
{
Tag -> Sensitive Text
key :: Core.Sensitive Prelude.Text,
Tag -> Sensitive Text
value :: Core.Sensitive Prelude.Text
}
deriving (Tag -> Tag -> Bool
(Tag -> Tag -> Bool) -> (Tag -> Tag -> Bool) -> Eq Tag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Tag -> Tag -> Bool
$c/= :: Tag -> Tag -> Bool
== :: Tag -> Tag -> Bool
$c== :: Tag -> Tag -> Bool
Prelude.Eq, Int -> Tag -> ShowS
[Tag] -> ShowS
Tag -> String
(Int -> Tag -> ShowS)
-> (Tag -> String) -> ([Tag] -> ShowS) -> Show Tag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Tag] -> ShowS
$cshowList :: [Tag] -> ShowS
show :: Tag -> String
$cshow :: Tag -> String
showsPrec :: Int -> Tag -> ShowS
$cshowsPrec :: Int -> Tag -> ShowS
Prelude.Show, (forall x. Tag -> Rep Tag x)
-> (forall x. Rep Tag x -> Tag) -> Generic Tag
forall x. Rep Tag x -> Tag
forall x. Tag -> Rep Tag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Tag x -> Tag
$cfrom :: forall x. Tag -> Rep Tag x
Prelude.Generic)
newTag ::
Prelude.Text ->
Prelude.Text ->
Tag
newTag :: Text -> Text -> Tag
newTag Text
pKey_ Text
pValue_ =
Tag' :: Sensitive Text -> Sensitive Text -> Tag
Tag'
{ $sel:key:Tag' :: Sensitive Text
key = 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
pKey_,
$sel:value:Tag' :: 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_
}
tag_key :: Lens.Lens' Tag Prelude.Text
tag_key :: (Text -> f Text) -> Tag -> f Tag
tag_key = (Tag -> Sensitive Text)
-> (Tag -> Sensitive Text -> Tag)
-> Lens Tag Tag (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tag' {Sensitive Text
key :: Sensitive Text
$sel:key:Tag' :: Tag -> Sensitive Text
key} -> Sensitive Text
key) (\s :: Tag
s@Tag' {} Sensitive Text
a -> Tag
s {$sel:key:Tag' :: Sensitive Text
key = Sensitive Text
a} :: Tag) ((Sensitive Text -> f (Sensitive Text)) -> Tag -> f Tag)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> Tag
-> f Tag
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
tag_value :: Lens.Lens' Tag Prelude.Text
tag_value :: (Text -> f Text) -> Tag -> f Tag
tag_value = (Tag -> Sensitive Text)
-> (Tag -> Sensitive Text -> Tag)
-> Lens Tag Tag (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tag' {Sensitive Text
value :: Sensitive Text
$sel:value:Tag' :: Tag -> Sensitive Text
value} -> Sensitive Text
value) (\s :: Tag
s@Tag' {} Sensitive Text
a -> Tag
s {$sel:value:Tag' :: Sensitive Text
value = Sensitive Text
a} :: Tag) ((Sensitive Text -> f (Sensitive Text)) -> Tag -> f Tag)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> Tag
-> f Tag
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 Tag
instance Prelude.NFData Tag
instance Core.ToJSON Tag where
toJSON :: Tag -> Value
toJSON Tag' {Sensitive Text
value :: Sensitive Text
key :: Sensitive Text
$sel:value:Tag' :: Tag -> Sensitive Text
$sel:key:Tag' :: Tag -> Sensitive 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 -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive 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)
]
)