{-# 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.ControlPlaneTagFilter where
import Amazonka.Connect.Types.TagCondition
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 ControlPlaneTagFilter = ControlPlaneTagFilter'
{
ControlPlaneTagFilter -> Maybe [TagCondition]
andConditions :: Prelude.Maybe [TagCondition],
ControlPlaneTagFilter -> Maybe [[TagCondition]]
orConditions :: Prelude.Maybe [[TagCondition]],
ControlPlaneTagFilter -> Maybe TagCondition
tagCondition :: Prelude.Maybe TagCondition
}
deriving (ControlPlaneTagFilter -> ControlPlaneTagFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ControlPlaneTagFilter -> ControlPlaneTagFilter -> Bool
$c/= :: ControlPlaneTagFilter -> ControlPlaneTagFilter -> Bool
== :: ControlPlaneTagFilter -> ControlPlaneTagFilter -> Bool
$c== :: ControlPlaneTagFilter -> ControlPlaneTagFilter -> Bool
Prelude.Eq, ReadPrec [ControlPlaneTagFilter]
ReadPrec ControlPlaneTagFilter
Int -> ReadS ControlPlaneTagFilter
ReadS [ControlPlaneTagFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ControlPlaneTagFilter]
$creadListPrec :: ReadPrec [ControlPlaneTagFilter]
readPrec :: ReadPrec ControlPlaneTagFilter
$creadPrec :: ReadPrec ControlPlaneTagFilter
readList :: ReadS [ControlPlaneTagFilter]
$creadList :: ReadS [ControlPlaneTagFilter]
readsPrec :: Int -> ReadS ControlPlaneTagFilter
$creadsPrec :: Int -> ReadS ControlPlaneTagFilter
Prelude.Read, Int -> ControlPlaneTagFilter -> ShowS
[ControlPlaneTagFilter] -> ShowS
ControlPlaneTagFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ControlPlaneTagFilter] -> ShowS
$cshowList :: [ControlPlaneTagFilter] -> ShowS
show :: ControlPlaneTagFilter -> String
$cshow :: ControlPlaneTagFilter -> String
showsPrec :: Int -> ControlPlaneTagFilter -> ShowS
$cshowsPrec :: Int -> ControlPlaneTagFilter -> ShowS
Prelude.Show, forall x. Rep ControlPlaneTagFilter x -> ControlPlaneTagFilter
forall x. ControlPlaneTagFilter -> Rep ControlPlaneTagFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ControlPlaneTagFilter x -> ControlPlaneTagFilter
$cfrom :: forall x. ControlPlaneTagFilter -> Rep ControlPlaneTagFilter x
Prelude.Generic)
newControlPlaneTagFilter ::
ControlPlaneTagFilter
newControlPlaneTagFilter :: ControlPlaneTagFilter
newControlPlaneTagFilter =
ControlPlaneTagFilter'
{ $sel:andConditions:ControlPlaneTagFilter' :: Maybe [TagCondition]
andConditions =
forall a. Maybe a
Prelude.Nothing,
$sel:orConditions:ControlPlaneTagFilter' :: Maybe [[TagCondition]]
orConditions = forall a. Maybe a
Prelude.Nothing,
$sel:tagCondition:ControlPlaneTagFilter' :: Maybe TagCondition
tagCondition = forall a. Maybe a
Prelude.Nothing
}
controlPlaneTagFilter_andConditions :: Lens.Lens' ControlPlaneTagFilter (Prelude.Maybe [TagCondition])
controlPlaneTagFilter_andConditions :: Lens' ControlPlaneTagFilter (Maybe [TagCondition])
controlPlaneTagFilter_andConditions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlPlaneTagFilter' {Maybe [TagCondition]
andConditions :: Maybe [TagCondition]
$sel:andConditions:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe [TagCondition]
andConditions} -> Maybe [TagCondition]
andConditions) (\s :: ControlPlaneTagFilter
s@ControlPlaneTagFilter' {} Maybe [TagCondition]
a -> ControlPlaneTagFilter
s {$sel:andConditions:ControlPlaneTagFilter' :: Maybe [TagCondition]
andConditions = Maybe [TagCondition]
a} :: ControlPlaneTagFilter) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
controlPlaneTagFilter_orConditions :: Lens.Lens' ControlPlaneTagFilter (Prelude.Maybe [[TagCondition]])
controlPlaneTagFilter_orConditions :: Lens' ControlPlaneTagFilter (Maybe [[TagCondition]])
controlPlaneTagFilter_orConditions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlPlaneTagFilter' {Maybe [[TagCondition]]
orConditions :: Maybe [[TagCondition]]
$sel:orConditions:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe [[TagCondition]]
orConditions} -> Maybe [[TagCondition]]
orConditions) (\s :: ControlPlaneTagFilter
s@ControlPlaneTagFilter' {} Maybe [[TagCondition]]
a -> ControlPlaneTagFilter
s {$sel:orConditions:ControlPlaneTagFilter' :: Maybe [[TagCondition]]
orConditions = Maybe [[TagCondition]]
a} :: ControlPlaneTagFilter) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
controlPlaneTagFilter_tagCondition :: Lens.Lens' ControlPlaneTagFilter (Prelude.Maybe TagCondition)
controlPlaneTagFilter_tagCondition :: Lens' ControlPlaneTagFilter (Maybe TagCondition)
controlPlaneTagFilter_tagCondition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlPlaneTagFilter' {Maybe TagCondition
tagCondition :: Maybe TagCondition
$sel:tagCondition:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe TagCondition
tagCondition} -> Maybe TagCondition
tagCondition) (\s :: ControlPlaneTagFilter
s@ControlPlaneTagFilter' {} Maybe TagCondition
a -> ControlPlaneTagFilter
s {$sel:tagCondition:ControlPlaneTagFilter' :: Maybe TagCondition
tagCondition = Maybe TagCondition
a} :: ControlPlaneTagFilter)
instance Prelude.Hashable ControlPlaneTagFilter where
hashWithSalt :: Int -> ControlPlaneTagFilter -> Int
hashWithSalt Int
_salt ControlPlaneTagFilter' {Maybe [[TagCondition]]
Maybe [TagCondition]
Maybe TagCondition
tagCondition :: Maybe TagCondition
orConditions :: Maybe [[TagCondition]]
andConditions :: Maybe [TagCondition]
$sel:tagCondition:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe TagCondition
$sel:orConditions:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe [[TagCondition]]
$sel:andConditions:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe [TagCondition]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagCondition]
andConditions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [[TagCondition]]
orConditions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TagCondition
tagCondition
instance Prelude.NFData ControlPlaneTagFilter where
rnf :: ControlPlaneTagFilter -> ()
rnf ControlPlaneTagFilter' {Maybe [[TagCondition]]
Maybe [TagCondition]
Maybe TagCondition
tagCondition :: Maybe TagCondition
orConditions :: Maybe [[TagCondition]]
andConditions :: Maybe [TagCondition]
$sel:tagCondition:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe TagCondition
$sel:orConditions:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe [[TagCondition]]
$sel:andConditions:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe [TagCondition]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagCondition]
andConditions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [[TagCondition]]
orConditions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TagCondition
tagCondition
instance Data.ToJSON ControlPlaneTagFilter where
toJSON :: ControlPlaneTagFilter -> Value
toJSON ControlPlaneTagFilter' {Maybe [[TagCondition]]
Maybe [TagCondition]
Maybe TagCondition
tagCondition :: Maybe TagCondition
orConditions :: Maybe [[TagCondition]]
andConditions :: Maybe [TagCondition]
$sel:tagCondition:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe TagCondition
$sel:orConditions:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe [[TagCondition]]
$sel:andConditions:ControlPlaneTagFilter' :: ControlPlaneTagFilter -> Maybe [TagCondition]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AndConditions" 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 [TagCondition]
andConditions,
(Key
"OrConditions" 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 [[TagCondition]]
orConditions,
(Key
"TagCondition" 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 TagCondition
tagCondition
]
)