{-# 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.AuditManager.Types.ControlSet where
import Amazonka.AuditManager.Types.Control
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ControlSet = ControlSet'
{
ControlSet -> Maybe (NonEmpty Control)
controls :: Prelude.Maybe (Prelude.NonEmpty Control),
ControlSet -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ControlSet -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (ControlSet -> ControlSet -> Bool
(ControlSet -> ControlSet -> Bool)
-> (ControlSet -> ControlSet -> Bool) -> Eq ControlSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ControlSet -> ControlSet -> Bool
$c/= :: ControlSet -> ControlSet -> Bool
== :: ControlSet -> ControlSet -> Bool
$c== :: ControlSet -> ControlSet -> Bool
Prelude.Eq, ReadPrec [ControlSet]
ReadPrec ControlSet
Int -> ReadS ControlSet
ReadS [ControlSet]
(Int -> ReadS ControlSet)
-> ReadS [ControlSet]
-> ReadPrec ControlSet
-> ReadPrec [ControlSet]
-> Read ControlSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ControlSet]
$creadListPrec :: ReadPrec [ControlSet]
readPrec :: ReadPrec ControlSet
$creadPrec :: ReadPrec ControlSet
readList :: ReadS [ControlSet]
$creadList :: ReadS [ControlSet]
readsPrec :: Int -> ReadS ControlSet
$creadsPrec :: Int -> ReadS ControlSet
Prelude.Read, Int -> ControlSet -> ShowS
[ControlSet] -> ShowS
ControlSet -> String
(Int -> ControlSet -> ShowS)
-> (ControlSet -> String)
-> ([ControlSet] -> ShowS)
-> Show ControlSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ControlSet] -> ShowS
$cshowList :: [ControlSet] -> ShowS
show :: ControlSet -> String
$cshow :: ControlSet -> String
showsPrec :: Int -> ControlSet -> ShowS
$cshowsPrec :: Int -> ControlSet -> ShowS
Prelude.Show, (forall x. ControlSet -> Rep ControlSet x)
-> (forall x. Rep ControlSet x -> ControlSet) -> Generic ControlSet
forall x. Rep ControlSet x -> ControlSet
forall x. ControlSet -> Rep ControlSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ControlSet x -> ControlSet
$cfrom :: forall x. ControlSet -> Rep ControlSet x
Prelude.Generic)
newControlSet ::
ControlSet
newControlSet :: ControlSet
newControlSet =
ControlSet' :: Maybe (NonEmpty Control) -> Maybe Text -> Maybe Text -> ControlSet
ControlSet'
{ $sel:controls:ControlSet' :: Maybe (NonEmpty Control)
controls = Maybe (NonEmpty Control)
forall a. Maybe a
Prelude.Nothing,
$sel:name:ControlSet' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:ControlSet' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
controlSet_controls :: Lens.Lens' ControlSet (Prelude.Maybe (Prelude.NonEmpty Control))
controlSet_controls :: (Maybe (NonEmpty Control) -> f (Maybe (NonEmpty Control)))
-> ControlSet -> f ControlSet
controlSet_controls = (ControlSet -> Maybe (NonEmpty Control))
-> (ControlSet -> Maybe (NonEmpty Control) -> ControlSet)
-> Lens
ControlSet
ControlSet
(Maybe (NonEmpty Control))
(Maybe (NonEmpty Control))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlSet' {Maybe (NonEmpty Control)
controls :: Maybe (NonEmpty Control)
$sel:controls:ControlSet' :: ControlSet -> Maybe (NonEmpty Control)
controls} -> Maybe (NonEmpty Control)
controls) (\s :: ControlSet
s@ControlSet' {} Maybe (NonEmpty Control)
a -> ControlSet
s {$sel:controls:ControlSet' :: Maybe (NonEmpty Control)
controls = Maybe (NonEmpty Control)
a} :: ControlSet) ((Maybe (NonEmpty Control) -> f (Maybe (NonEmpty Control)))
-> ControlSet -> f ControlSet)
-> ((Maybe (NonEmpty Control) -> f (Maybe (NonEmpty Control)))
-> Maybe (NonEmpty Control) -> f (Maybe (NonEmpty Control)))
-> (Maybe (NonEmpty Control) -> f (Maybe (NonEmpty Control)))
-> ControlSet
-> f ControlSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Control)
(NonEmpty Control)
(NonEmpty Control)
(NonEmpty Control)
-> Iso
(Maybe (NonEmpty Control))
(Maybe (NonEmpty Control))
(Maybe (NonEmpty Control))
(Maybe (NonEmpty Control))
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 AnIso
(NonEmpty Control)
(NonEmpty Control)
(NonEmpty Control)
(NonEmpty Control)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
controlSet_name :: Lens.Lens' ControlSet (Prelude.Maybe Prelude.Text)
controlSet_name :: (Maybe Text -> f (Maybe Text)) -> ControlSet -> f ControlSet
controlSet_name = (ControlSet -> Maybe Text)
-> (ControlSet -> Maybe Text -> ControlSet)
-> Lens ControlSet ControlSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlSet' {Maybe Text
name :: Maybe Text
$sel:name:ControlSet' :: ControlSet -> Maybe Text
name} -> Maybe Text
name) (\s :: ControlSet
s@ControlSet' {} Maybe Text
a -> ControlSet
s {$sel:name:ControlSet' :: Maybe Text
name = Maybe Text
a} :: ControlSet)
controlSet_id :: Lens.Lens' ControlSet (Prelude.Maybe Prelude.Text)
controlSet_id :: (Maybe Text -> f (Maybe Text)) -> ControlSet -> f ControlSet
controlSet_id = (ControlSet -> Maybe Text)
-> (ControlSet -> Maybe Text -> ControlSet)
-> Lens ControlSet ControlSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlSet' {Maybe Text
id :: Maybe Text
$sel:id:ControlSet' :: ControlSet -> Maybe Text
id} -> Maybe Text
id) (\s :: ControlSet
s@ControlSet' {} Maybe Text
a -> ControlSet
s {$sel:id:ControlSet' :: Maybe Text
id = Maybe Text
a} :: ControlSet)
instance Core.FromJSON ControlSet where
parseJSON :: Value -> Parser ControlSet
parseJSON =
String
-> (Object -> Parser ControlSet) -> Value -> Parser ControlSet
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ControlSet"
( \Object
x ->
Maybe (NonEmpty Control) -> Maybe Text -> Maybe Text -> ControlSet
ControlSet'
(Maybe (NonEmpty Control)
-> Maybe Text -> Maybe Text -> ControlSet)
-> Parser (Maybe (NonEmpty Control))
-> Parser (Maybe Text -> Maybe Text -> ControlSet)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Control))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"controls")
Parser (Maybe Text -> Maybe Text -> ControlSet)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ControlSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
Parser (Maybe Text -> ControlSet)
-> Parser (Maybe Text) -> Parser ControlSet
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"id")
)
instance Prelude.Hashable ControlSet
instance Prelude.NFData ControlSet