{-# 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.SSM.Types.PatchRuleGroup 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
import Amazonka.SSM.Types.PatchRule
data PatchRuleGroup = PatchRuleGroup'
{
PatchRuleGroup -> [PatchRule]
patchRules :: [PatchRule]
}
deriving (PatchRuleGroup -> PatchRuleGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PatchRuleGroup -> PatchRuleGroup -> Bool
$c/= :: PatchRuleGroup -> PatchRuleGroup -> Bool
== :: PatchRuleGroup -> PatchRuleGroup -> Bool
$c== :: PatchRuleGroup -> PatchRuleGroup -> Bool
Prelude.Eq, ReadPrec [PatchRuleGroup]
ReadPrec PatchRuleGroup
Int -> ReadS PatchRuleGroup
ReadS [PatchRuleGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PatchRuleGroup]
$creadListPrec :: ReadPrec [PatchRuleGroup]
readPrec :: ReadPrec PatchRuleGroup
$creadPrec :: ReadPrec PatchRuleGroup
readList :: ReadS [PatchRuleGroup]
$creadList :: ReadS [PatchRuleGroup]
readsPrec :: Int -> ReadS PatchRuleGroup
$creadsPrec :: Int -> ReadS PatchRuleGroup
Prelude.Read, Int -> PatchRuleGroup -> ShowS
[PatchRuleGroup] -> ShowS
PatchRuleGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PatchRuleGroup] -> ShowS
$cshowList :: [PatchRuleGroup] -> ShowS
show :: PatchRuleGroup -> String
$cshow :: PatchRuleGroup -> String
showsPrec :: Int -> PatchRuleGroup -> ShowS
$cshowsPrec :: Int -> PatchRuleGroup -> ShowS
Prelude.Show, forall x. Rep PatchRuleGroup x -> PatchRuleGroup
forall x. PatchRuleGroup -> Rep PatchRuleGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PatchRuleGroup x -> PatchRuleGroup
$cfrom :: forall x. PatchRuleGroup -> Rep PatchRuleGroup x
Prelude.Generic)
newPatchRuleGroup ::
PatchRuleGroup
newPatchRuleGroup :: PatchRuleGroup
newPatchRuleGroup =
PatchRuleGroup' {$sel:patchRules:PatchRuleGroup' :: [PatchRule]
patchRules = forall a. Monoid a => a
Prelude.mempty}
patchRuleGroup_patchRules :: Lens.Lens' PatchRuleGroup [PatchRule]
patchRuleGroup_patchRules :: Lens' PatchRuleGroup [PatchRule]
patchRuleGroup_patchRules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchRuleGroup' {[PatchRule]
patchRules :: [PatchRule]
$sel:patchRules:PatchRuleGroup' :: PatchRuleGroup -> [PatchRule]
patchRules} -> [PatchRule]
patchRules) (\s :: PatchRuleGroup
s@PatchRuleGroup' {} [PatchRule]
a -> PatchRuleGroup
s {$sel:patchRules:PatchRuleGroup' :: [PatchRule]
patchRules = [PatchRule]
a} :: PatchRuleGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON PatchRuleGroup where
parseJSON :: Value -> Parser PatchRuleGroup
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PatchRuleGroup"
( \Object
x ->
[PatchRule] -> PatchRuleGroup
PatchRuleGroup'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PatchRules" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable PatchRuleGroup where
hashWithSalt :: Int -> PatchRuleGroup -> Int
hashWithSalt Int
_salt PatchRuleGroup' {[PatchRule]
patchRules :: [PatchRule]
$sel:patchRules:PatchRuleGroup' :: PatchRuleGroup -> [PatchRule]
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [PatchRule]
patchRules
instance Prelude.NFData PatchRuleGroup where
rnf :: PatchRuleGroup -> ()
rnf PatchRuleGroup' {[PatchRule]
patchRules :: [PatchRule]
$sel:patchRules:PatchRuleGroup' :: PatchRuleGroup -> [PatchRule]
..} = forall a. NFData a => a -> ()
Prelude.rnf [PatchRule]
patchRules
instance Data.ToJSON PatchRuleGroup where
toJSON :: PatchRuleGroup -> Value
toJSON PatchRuleGroup' {[PatchRule]
patchRules :: [PatchRule]
$sel:patchRules:PatchRuleGroup' :: PatchRuleGroup -> [PatchRule]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"PatchRules" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [PatchRule]
patchRules)]
)