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