{-# 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.Config.Types.RemediationException 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
data RemediationException = RemediationException'
{
RemediationException -> Maybe POSIX
expirationTime :: Prelude.Maybe Data.POSIX,
RemediationException -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
RemediationException -> Text
configRuleName :: Prelude.Text,
RemediationException -> Text
resourceType :: Prelude.Text,
RemediationException -> Text
resourceId :: Prelude.Text
}
deriving (RemediationException -> RemediationException -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemediationException -> RemediationException -> Bool
$c/= :: RemediationException -> RemediationException -> Bool
== :: RemediationException -> RemediationException -> Bool
$c== :: RemediationException -> RemediationException -> Bool
Prelude.Eq, ReadPrec [RemediationException]
ReadPrec RemediationException
Int -> ReadS RemediationException
ReadS [RemediationException]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemediationException]
$creadListPrec :: ReadPrec [RemediationException]
readPrec :: ReadPrec RemediationException
$creadPrec :: ReadPrec RemediationException
readList :: ReadS [RemediationException]
$creadList :: ReadS [RemediationException]
readsPrec :: Int -> ReadS RemediationException
$creadsPrec :: Int -> ReadS RemediationException
Prelude.Read, Int -> RemediationException -> ShowS
[RemediationException] -> ShowS
RemediationException -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemediationException] -> ShowS
$cshowList :: [RemediationException] -> ShowS
show :: RemediationException -> String
$cshow :: RemediationException -> String
showsPrec :: Int -> RemediationException -> ShowS
$cshowsPrec :: Int -> RemediationException -> ShowS
Prelude.Show, forall x. Rep RemediationException x -> RemediationException
forall x. RemediationException -> Rep RemediationException x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemediationException x -> RemediationException
$cfrom :: forall x. RemediationException -> Rep RemediationException x
Prelude.Generic)
newRemediationException ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
RemediationException
newRemediationException :: Text -> Text -> Text -> RemediationException
newRemediationException
Text
pConfigRuleName_
Text
pResourceType_
Text
pResourceId_ =
RemediationException'
{ $sel:expirationTime:RemediationException' :: Maybe POSIX
expirationTime =
forall a. Maybe a
Prelude.Nothing,
$sel:message:RemediationException' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
$sel:configRuleName:RemediationException' :: Text
configRuleName = Text
pConfigRuleName_,
$sel:resourceType:RemediationException' :: Text
resourceType = Text
pResourceType_,
$sel:resourceId:RemediationException' :: Text
resourceId = Text
pResourceId_
}
remediationException_expirationTime :: Lens.Lens' RemediationException (Prelude.Maybe Prelude.UTCTime)
remediationException_expirationTime :: Lens' RemediationException (Maybe UTCTime)
remediationException_expirationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationException' {Maybe POSIX
expirationTime :: Maybe POSIX
$sel:expirationTime:RemediationException' :: RemediationException -> Maybe POSIX
expirationTime} -> Maybe POSIX
expirationTime) (\s :: RemediationException
s@RemediationException' {} Maybe POSIX
a -> RemediationException
s {$sel:expirationTime:RemediationException' :: Maybe POSIX
expirationTime = Maybe POSIX
a} :: RemediationException) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
remediationException_message :: Lens.Lens' RemediationException (Prelude.Maybe Prelude.Text)
remediationException_message :: Lens' RemediationException (Maybe Text)
remediationException_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationException' {Maybe Text
message :: Maybe Text
$sel:message:RemediationException' :: RemediationException -> Maybe Text
message} -> Maybe Text
message) (\s :: RemediationException
s@RemediationException' {} Maybe Text
a -> RemediationException
s {$sel:message:RemediationException' :: Maybe Text
message = Maybe Text
a} :: RemediationException)
remediationException_configRuleName :: Lens.Lens' RemediationException Prelude.Text
remediationException_configRuleName :: Lens' RemediationException Text
remediationException_configRuleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationException' {Text
configRuleName :: Text
$sel:configRuleName:RemediationException' :: RemediationException -> Text
configRuleName} -> Text
configRuleName) (\s :: RemediationException
s@RemediationException' {} Text
a -> RemediationException
s {$sel:configRuleName:RemediationException' :: Text
configRuleName = Text
a} :: RemediationException)
remediationException_resourceType :: Lens.Lens' RemediationException Prelude.Text
remediationException_resourceType :: Lens' RemediationException Text
remediationException_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationException' {Text
resourceType :: Text
$sel:resourceType:RemediationException' :: RemediationException -> Text
resourceType} -> Text
resourceType) (\s :: RemediationException
s@RemediationException' {} Text
a -> RemediationException
s {$sel:resourceType:RemediationException' :: Text
resourceType = Text
a} :: RemediationException)
remediationException_resourceId :: Lens.Lens' RemediationException Prelude.Text
remediationException_resourceId :: Lens' RemediationException Text
remediationException_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationException' {Text
resourceId :: Text
$sel:resourceId:RemediationException' :: RemediationException -> Text
resourceId} -> Text
resourceId) (\s :: RemediationException
s@RemediationException' {} Text
a -> RemediationException
s {$sel:resourceId:RemediationException' :: Text
resourceId = Text
a} :: RemediationException)
instance Data.FromJSON RemediationException where
parseJSON :: Value -> Parser RemediationException
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RemediationException"
( \Object
x ->
Maybe POSIX
-> Maybe Text -> Text -> Text -> Text -> RemediationException
RemediationException'
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
"ExpirationTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Message")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ConfigRuleName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ResourceType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ResourceId")
)
instance Prelude.Hashable RemediationException where
hashWithSalt :: Int -> RemediationException -> Int
hashWithSalt Int
_salt RemediationException' {Maybe Text
Maybe POSIX
Text
resourceId :: Text
resourceType :: Text
configRuleName :: Text
message :: Maybe Text
expirationTime :: Maybe POSIX
$sel:resourceId:RemediationException' :: RemediationException -> Text
$sel:resourceType:RemediationException' :: RemediationException -> Text
$sel:configRuleName:RemediationException' :: RemediationException -> Text
$sel:message:RemediationException' :: RemediationException -> Maybe Text
$sel:expirationTime:RemediationException' :: RemediationException -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
expirationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
configRuleName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceId
instance Prelude.NFData RemediationException where
rnf :: RemediationException -> ()
rnf RemediationException' {Maybe Text
Maybe POSIX
Text
resourceId :: Text
resourceType :: Text
configRuleName :: Text
message :: Maybe Text
expirationTime :: Maybe POSIX
$sel:resourceId:RemediationException' :: RemediationException -> Text
$sel:resourceType:RemediationException' :: RemediationException -> Text
$sel:configRuleName:RemediationException' :: RemediationException -> Text
$sel:message:RemediationException' :: RemediationException -> Maybe Text
$sel:expirationTime:RemediationException' :: RemediationException -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
expirationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
configRuleName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceId