{-# 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.EffectivePatch where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.Patch
import Amazonka.SSM.Types.PatchStatus
data EffectivePatch = EffectivePatch'
{
EffectivePatch -> Maybe Patch
patch :: Prelude.Maybe Patch,
EffectivePatch -> Maybe PatchStatus
patchStatus :: Prelude.Maybe PatchStatus
}
deriving (EffectivePatch -> EffectivePatch -> Bool
(EffectivePatch -> EffectivePatch -> Bool)
-> (EffectivePatch -> EffectivePatch -> Bool) -> Eq EffectivePatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EffectivePatch -> EffectivePatch -> Bool
$c/= :: EffectivePatch -> EffectivePatch -> Bool
== :: EffectivePatch -> EffectivePatch -> Bool
$c== :: EffectivePatch -> EffectivePatch -> Bool
Prelude.Eq, ReadPrec [EffectivePatch]
ReadPrec EffectivePatch
Int -> ReadS EffectivePatch
ReadS [EffectivePatch]
(Int -> ReadS EffectivePatch)
-> ReadS [EffectivePatch]
-> ReadPrec EffectivePatch
-> ReadPrec [EffectivePatch]
-> Read EffectivePatch
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EffectivePatch]
$creadListPrec :: ReadPrec [EffectivePatch]
readPrec :: ReadPrec EffectivePatch
$creadPrec :: ReadPrec EffectivePatch
readList :: ReadS [EffectivePatch]
$creadList :: ReadS [EffectivePatch]
readsPrec :: Int -> ReadS EffectivePatch
$creadsPrec :: Int -> ReadS EffectivePatch
Prelude.Read, Int -> EffectivePatch -> ShowS
[EffectivePatch] -> ShowS
EffectivePatch -> String
(Int -> EffectivePatch -> ShowS)
-> (EffectivePatch -> String)
-> ([EffectivePatch] -> ShowS)
-> Show EffectivePatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EffectivePatch] -> ShowS
$cshowList :: [EffectivePatch] -> ShowS
show :: EffectivePatch -> String
$cshow :: EffectivePatch -> String
showsPrec :: Int -> EffectivePatch -> ShowS
$cshowsPrec :: Int -> EffectivePatch -> ShowS
Prelude.Show, (forall x. EffectivePatch -> Rep EffectivePatch x)
-> (forall x. Rep EffectivePatch x -> EffectivePatch)
-> Generic EffectivePatch
forall x. Rep EffectivePatch x -> EffectivePatch
forall x. EffectivePatch -> Rep EffectivePatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EffectivePatch x -> EffectivePatch
$cfrom :: forall x. EffectivePatch -> Rep EffectivePatch x
Prelude.Generic)
newEffectivePatch ::
EffectivePatch
newEffectivePatch :: EffectivePatch
newEffectivePatch =
EffectivePatch' :: Maybe Patch -> Maybe PatchStatus -> EffectivePatch
EffectivePatch'
{ $sel:patch:EffectivePatch' :: Maybe Patch
patch = Maybe Patch
forall a. Maybe a
Prelude.Nothing,
$sel:patchStatus:EffectivePatch' :: Maybe PatchStatus
patchStatus = Maybe PatchStatus
forall a. Maybe a
Prelude.Nothing
}
effectivePatch_patch :: Lens.Lens' EffectivePatch (Prelude.Maybe Patch)
effectivePatch_patch :: (Maybe Patch -> f (Maybe Patch))
-> EffectivePatch -> f EffectivePatch
effectivePatch_patch = (EffectivePatch -> Maybe Patch)
-> (EffectivePatch -> Maybe Patch -> EffectivePatch)
-> Lens EffectivePatch EffectivePatch (Maybe Patch) (Maybe Patch)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EffectivePatch' {Maybe Patch
patch :: Maybe Patch
$sel:patch:EffectivePatch' :: EffectivePatch -> Maybe Patch
patch} -> Maybe Patch
patch) (\s :: EffectivePatch
s@EffectivePatch' {} Maybe Patch
a -> EffectivePatch
s {$sel:patch:EffectivePatch' :: Maybe Patch
patch = Maybe Patch
a} :: EffectivePatch)
effectivePatch_patchStatus :: Lens.Lens' EffectivePatch (Prelude.Maybe PatchStatus)
effectivePatch_patchStatus :: (Maybe PatchStatus -> f (Maybe PatchStatus))
-> EffectivePatch -> f EffectivePatch
effectivePatch_patchStatus = (EffectivePatch -> Maybe PatchStatus)
-> (EffectivePatch -> Maybe PatchStatus -> EffectivePatch)
-> Lens
EffectivePatch
EffectivePatch
(Maybe PatchStatus)
(Maybe PatchStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EffectivePatch' {Maybe PatchStatus
patchStatus :: Maybe PatchStatus
$sel:patchStatus:EffectivePatch' :: EffectivePatch -> Maybe PatchStatus
patchStatus} -> Maybe PatchStatus
patchStatus) (\s :: EffectivePatch
s@EffectivePatch' {} Maybe PatchStatus
a -> EffectivePatch
s {$sel:patchStatus:EffectivePatch' :: Maybe PatchStatus
patchStatus = Maybe PatchStatus
a} :: EffectivePatch)
instance Core.FromJSON EffectivePatch where
parseJSON :: Value -> Parser EffectivePatch
parseJSON =
String
-> (Object -> Parser EffectivePatch)
-> Value
-> Parser EffectivePatch
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EffectivePatch"
( \Object
x ->
Maybe Patch -> Maybe PatchStatus -> EffectivePatch
EffectivePatch'
(Maybe Patch -> Maybe PatchStatus -> EffectivePatch)
-> Parser (Maybe Patch)
-> Parser (Maybe PatchStatus -> EffectivePatch)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Patch)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Patch")
Parser (Maybe PatchStatus -> EffectivePatch)
-> Parser (Maybe PatchStatus) -> Parser EffectivePatch
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PatchStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PatchStatus")
)
instance Prelude.Hashable EffectivePatch
instance Prelude.NFData EffectivePatch