{-# 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.Connect.Types.TagCondition 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 TagCondition = TagCondition'
{
TagCondition -> Maybe Text
tagKey :: Prelude.Maybe Prelude.Text,
TagCondition -> Maybe Text
tagValue :: Prelude.Maybe Prelude.Text
}
deriving (TagCondition -> TagCondition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagCondition -> TagCondition -> Bool
$c/= :: TagCondition -> TagCondition -> Bool
== :: TagCondition -> TagCondition -> Bool
$c== :: TagCondition -> TagCondition -> Bool
Prelude.Eq, ReadPrec [TagCondition]
ReadPrec TagCondition
Int -> ReadS TagCondition
ReadS [TagCondition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagCondition]
$creadListPrec :: ReadPrec [TagCondition]
readPrec :: ReadPrec TagCondition
$creadPrec :: ReadPrec TagCondition
readList :: ReadS [TagCondition]
$creadList :: ReadS [TagCondition]
readsPrec :: Int -> ReadS TagCondition
$creadsPrec :: Int -> ReadS TagCondition
Prelude.Read, Int -> TagCondition -> ShowS
[TagCondition] -> ShowS
TagCondition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagCondition] -> ShowS
$cshowList :: [TagCondition] -> ShowS
show :: TagCondition -> String
$cshow :: TagCondition -> String
showsPrec :: Int -> TagCondition -> ShowS
$cshowsPrec :: Int -> TagCondition -> ShowS
Prelude.Show, forall x. Rep TagCondition x -> TagCondition
forall x. TagCondition -> Rep TagCondition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TagCondition x -> TagCondition
$cfrom :: forall x. TagCondition -> Rep TagCondition x
Prelude.Generic)
newTagCondition ::
TagCondition
newTagCondition :: TagCondition
newTagCondition =
TagCondition'
{ $sel:tagKey:TagCondition' :: Maybe Text
tagKey = forall a. Maybe a
Prelude.Nothing,
$sel:tagValue:TagCondition' :: Maybe Text
tagValue = forall a. Maybe a
Prelude.Nothing
}
tagCondition_tagKey :: Lens.Lens' TagCondition (Prelude.Maybe Prelude.Text)
tagCondition_tagKey :: Lens' TagCondition (Maybe Text)
tagCondition_tagKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagCondition' {Maybe Text
tagKey :: Maybe Text
$sel:tagKey:TagCondition' :: TagCondition -> Maybe Text
tagKey} -> Maybe Text
tagKey) (\s :: TagCondition
s@TagCondition' {} Maybe Text
a -> TagCondition
s {$sel:tagKey:TagCondition' :: Maybe Text
tagKey = Maybe Text
a} :: TagCondition)
tagCondition_tagValue :: Lens.Lens' TagCondition (Prelude.Maybe Prelude.Text)
tagCondition_tagValue :: Lens' TagCondition (Maybe Text)
tagCondition_tagValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagCondition' {Maybe Text
tagValue :: Maybe Text
$sel:tagValue:TagCondition' :: TagCondition -> Maybe Text
tagValue} -> Maybe Text
tagValue) (\s :: TagCondition
s@TagCondition' {} Maybe Text
a -> TagCondition
s {$sel:tagValue:TagCondition' :: Maybe Text
tagValue = Maybe Text
a} :: TagCondition)
instance Prelude.Hashable TagCondition where
hashWithSalt :: Int -> TagCondition -> Int
hashWithSalt Int
_salt TagCondition' {Maybe Text
tagValue :: Maybe Text
tagKey :: Maybe Text
$sel:tagValue:TagCondition' :: TagCondition -> Maybe Text
$sel:tagKey:TagCondition' :: TagCondition -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tagKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tagValue
instance Prelude.NFData TagCondition where
rnf :: TagCondition -> ()
rnf TagCondition' {Maybe Text
tagValue :: Maybe Text
tagKey :: Maybe Text
$sel:tagValue:TagCondition' :: TagCondition -> Maybe Text
$sel:tagKey:TagCondition' :: TagCondition -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tagKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tagValue
instance Data.ToJSON TagCondition where
toJSON :: TagCondition -> Value
toJSON TagCondition' {Maybe Text
tagValue :: Maybe Text
tagKey :: Maybe Text
$sel:tagValue:TagCondition' :: TagCondition -> Maybe Text
$sel:tagKey:TagCondition' :: TagCondition -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"TagKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
tagKey,
(Key
"TagValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
tagValue
]
)