{-# 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.ComplianceItemEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.ComplianceSeverity
import Amazonka.SSM.Types.ComplianceStatus
data ComplianceItemEntry = ComplianceItemEntry'
{
ComplianceItemEntry -> Maybe (HashMap Text Text)
details :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ComplianceItemEntry -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
ComplianceItemEntry -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
ComplianceItemEntry -> ComplianceSeverity
severity :: ComplianceSeverity,
ComplianceItemEntry -> ComplianceStatus
status :: ComplianceStatus
}
deriving (ComplianceItemEntry -> ComplianceItemEntry -> Bool
(ComplianceItemEntry -> ComplianceItemEntry -> Bool)
-> (ComplianceItemEntry -> ComplianceItemEntry -> Bool)
-> Eq ComplianceItemEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComplianceItemEntry -> ComplianceItemEntry -> Bool
$c/= :: ComplianceItemEntry -> ComplianceItemEntry -> Bool
== :: ComplianceItemEntry -> ComplianceItemEntry -> Bool
$c== :: ComplianceItemEntry -> ComplianceItemEntry -> Bool
Prelude.Eq, ReadPrec [ComplianceItemEntry]
ReadPrec ComplianceItemEntry
Int -> ReadS ComplianceItemEntry
ReadS [ComplianceItemEntry]
(Int -> ReadS ComplianceItemEntry)
-> ReadS [ComplianceItemEntry]
-> ReadPrec ComplianceItemEntry
-> ReadPrec [ComplianceItemEntry]
-> Read ComplianceItemEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComplianceItemEntry]
$creadListPrec :: ReadPrec [ComplianceItemEntry]
readPrec :: ReadPrec ComplianceItemEntry
$creadPrec :: ReadPrec ComplianceItemEntry
readList :: ReadS [ComplianceItemEntry]
$creadList :: ReadS [ComplianceItemEntry]
readsPrec :: Int -> ReadS ComplianceItemEntry
$creadsPrec :: Int -> ReadS ComplianceItemEntry
Prelude.Read, Int -> ComplianceItemEntry -> ShowS
[ComplianceItemEntry] -> ShowS
ComplianceItemEntry -> String
(Int -> ComplianceItemEntry -> ShowS)
-> (ComplianceItemEntry -> String)
-> ([ComplianceItemEntry] -> ShowS)
-> Show ComplianceItemEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComplianceItemEntry] -> ShowS
$cshowList :: [ComplianceItemEntry] -> ShowS
show :: ComplianceItemEntry -> String
$cshow :: ComplianceItemEntry -> String
showsPrec :: Int -> ComplianceItemEntry -> ShowS
$cshowsPrec :: Int -> ComplianceItemEntry -> ShowS
Prelude.Show, (forall x. ComplianceItemEntry -> Rep ComplianceItemEntry x)
-> (forall x. Rep ComplianceItemEntry x -> ComplianceItemEntry)
-> Generic ComplianceItemEntry
forall x. Rep ComplianceItemEntry x -> ComplianceItemEntry
forall x. ComplianceItemEntry -> Rep ComplianceItemEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComplianceItemEntry x -> ComplianceItemEntry
$cfrom :: forall x. ComplianceItemEntry -> Rep ComplianceItemEntry x
Prelude.Generic)
newComplianceItemEntry ::
ComplianceSeverity ->
ComplianceStatus ->
ComplianceItemEntry
newComplianceItemEntry :: ComplianceSeverity -> ComplianceStatus -> ComplianceItemEntry
newComplianceItemEntry ComplianceSeverity
pSeverity_ ComplianceStatus
pStatus_ =
ComplianceItemEntry' :: Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> ComplianceSeverity
-> ComplianceStatus
-> ComplianceItemEntry
ComplianceItemEntry'
{ $sel:details:ComplianceItemEntry' :: Maybe (HashMap Text Text)
details = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:id:ComplianceItemEntry' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:title:ComplianceItemEntry' :: Maybe Text
title = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:severity:ComplianceItemEntry' :: ComplianceSeverity
severity = ComplianceSeverity
pSeverity_,
$sel:status:ComplianceItemEntry' :: ComplianceStatus
status = ComplianceStatus
pStatus_
}
complianceItemEntry_details :: Lens.Lens' ComplianceItemEntry (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
complianceItemEntry_details :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ComplianceItemEntry -> f ComplianceItemEntry
complianceItemEntry_details = (ComplianceItemEntry -> Maybe (HashMap Text Text))
-> (ComplianceItemEntry
-> Maybe (HashMap Text Text) -> ComplianceItemEntry)
-> Lens
ComplianceItemEntry
ComplianceItemEntry
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceItemEntry' {Maybe (HashMap Text Text)
details :: Maybe (HashMap Text Text)
$sel:details:ComplianceItemEntry' :: ComplianceItemEntry -> Maybe (HashMap Text Text)
details} -> Maybe (HashMap Text Text)
details) (\s :: ComplianceItemEntry
s@ComplianceItemEntry' {} Maybe (HashMap Text Text)
a -> ComplianceItemEntry
s {$sel:details:ComplianceItemEntry' :: Maybe (HashMap Text Text)
details = Maybe (HashMap Text Text)
a} :: ComplianceItemEntry) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ComplianceItemEntry -> f ComplianceItemEntry)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ComplianceItemEntry
-> f ComplianceItemEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
complianceItemEntry_id :: Lens.Lens' ComplianceItemEntry (Prelude.Maybe Prelude.Text)
complianceItemEntry_id :: (Maybe Text -> f (Maybe Text))
-> ComplianceItemEntry -> f ComplianceItemEntry
complianceItemEntry_id = (ComplianceItemEntry -> Maybe Text)
-> (ComplianceItemEntry -> Maybe Text -> ComplianceItemEntry)
-> Lens
ComplianceItemEntry ComplianceItemEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceItemEntry' {Maybe Text
id :: Maybe Text
$sel:id:ComplianceItemEntry' :: ComplianceItemEntry -> Maybe Text
id} -> Maybe Text
id) (\s :: ComplianceItemEntry
s@ComplianceItemEntry' {} Maybe Text
a -> ComplianceItemEntry
s {$sel:id:ComplianceItemEntry' :: Maybe Text
id = Maybe Text
a} :: ComplianceItemEntry)
complianceItemEntry_title :: Lens.Lens' ComplianceItemEntry (Prelude.Maybe Prelude.Text)
complianceItemEntry_title :: (Maybe Text -> f (Maybe Text))
-> ComplianceItemEntry -> f ComplianceItemEntry
complianceItemEntry_title = (ComplianceItemEntry -> Maybe Text)
-> (ComplianceItemEntry -> Maybe Text -> ComplianceItemEntry)
-> Lens
ComplianceItemEntry ComplianceItemEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceItemEntry' {Maybe Text
title :: Maybe Text
$sel:title:ComplianceItemEntry' :: ComplianceItemEntry -> Maybe Text
title} -> Maybe Text
title) (\s :: ComplianceItemEntry
s@ComplianceItemEntry' {} Maybe Text
a -> ComplianceItemEntry
s {$sel:title:ComplianceItemEntry' :: Maybe Text
title = Maybe Text
a} :: ComplianceItemEntry)
complianceItemEntry_severity :: Lens.Lens' ComplianceItemEntry ComplianceSeverity
complianceItemEntry_severity :: (ComplianceSeverity -> f ComplianceSeverity)
-> ComplianceItemEntry -> f ComplianceItemEntry
complianceItemEntry_severity = (ComplianceItemEntry -> ComplianceSeverity)
-> (ComplianceItemEntry
-> ComplianceSeverity -> ComplianceItemEntry)
-> Lens
ComplianceItemEntry
ComplianceItemEntry
ComplianceSeverity
ComplianceSeverity
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceItemEntry' {ComplianceSeverity
severity :: ComplianceSeverity
$sel:severity:ComplianceItemEntry' :: ComplianceItemEntry -> ComplianceSeverity
severity} -> ComplianceSeverity
severity) (\s :: ComplianceItemEntry
s@ComplianceItemEntry' {} ComplianceSeverity
a -> ComplianceItemEntry
s {$sel:severity:ComplianceItemEntry' :: ComplianceSeverity
severity = ComplianceSeverity
a} :: ComplianceItemEntry)
complianceItemEntry_status :: Lens.Lens' ComplianceItemEntry ComplianceStatus
complianceItemEntry_status :: (ComplianceStatus -> f ComplianceStatus)
-> ComplianceItemEntry -> f ComplianceItemEntry
complianceItemEntry_status = (ComplianceItemEntry -> ComplianceStatus)
-> (ComplianceItemEntry -> ComplianceStatus -> ComplianceItemEntry)
-> Lens
ComplianceItemEntry
ComplianceItemEntry
ComplianceStatus
ComplianceStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceItemEntry' {ComplianceStatus
status :: ComplianceStatus
$sel:status:ComplianceItemEntry' :: ComplianceItemEntry -> ComplianceStatus
status} -> ComplianceStatus
status) (\s :: ComplianceItemEntry
s@ComplianceItemEntry' {} ComplianceStatus
a -> ComplianceItemEntry
s {$sel:status:ComplianceItemEntry' :: ComplianceStatus
status = ComplianceStatus
a} :: ComplianceItemEntry)
instance Prelude.Hashable ComplianceItemEntry
instance Prelude.NFData ComplianceItemEntry
instance Core.ToJSON ComplianceItemEntry where
toJSON :: ComplianceItemEntry -> Value
toJSON ComplianceItemEntry' {Maybe Text
Maybe (HashMap Text Text)
ComplianceSeverity
ComplianceStatus
status :: ComplianceStatus
severity :: ComplianceSeverity
title :: Maybe Text
id :: Maybe Text
details :: Maybe (HashMap Text Text)
$sel:status:ComplianceItemEntry' :: ComplianceItemEntry -> ComplianceStatus
$sel:severity:ComplianceItemEntry' :: ComplianceItemEntry -> ComplianceSeverity
$sel:title:ComplianceItemEntry' :: ComplianceItemEntry -> Maybe Text
$sel:id:ComplianceItemEntry' :: ComplianceItemEntry -> Maybe Text
$sel:details:ComplianceItemEntry' :: ComplianceItemEntry -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Details" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
details,
(Text
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
id,
(Text
"Title" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
title,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Severity" Text -> ComplianceSeverity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ComplianceSeverity
severity),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Status" Text -> ComplianceStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ComplianceStatus
status)
]
)