{-# 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.IoT.Types.AuditSuppression where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types.ResourceIdentifier
import qualified Amazonka.Prelude as Prelude
data AuditSuppression = AuditSuppression'
{
AuditSuppression -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
AuditSuppression -> Maybe POSIX
expirationDate :: Prelude.Maybe Data.POSIX,
AuditSuppression -> Maybe Bool
suppressIndefinitely :: Prelude.Maybe Prelude.Bool,
AuditSuppression -> Text
checkName :: Prelude.Text,
AuditSuppression -> ResourceIdentifier
resourceIdentifier :: ResourceIdentifier
}
deriving (AuditSuppression -> AuditSuppression -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuditSuppression -> AuditSuppression -> Bool
$c/= :: AuditSuppression -> AuditSuppression -> Bool
== :: AuditSuppression -> AuditSuppression -> Bool
$c== :: AuditSuppression -> AuditSuppression -> Bool
Prelude.Eq, ReadPrec [AuditSuppression]
ReadPrec AuditSuppression
Int -> ReadS AuditSuppression
ReadS [AuditSuppression]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuditSuppression]
$creadListPrec :: ReadPrec [AuditSuppression]
readPrec :: ReadPrec AuditSuppression
$creadPrec :: ReadPrec AuditSuppression
readList :: ReadS [AuditSuppression]
$creadList :: ReadS [AuditSuppression]
readsPrec :: Int -> ReadS AuditSuppression
$creadsPrec :: Int -> ReadS AuditSuppression
Prelude.Read, Int -> AuditSuppression -> ShowS
[AuditSuppression] -> ShowS
AuditSuppression -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuditSuppression] -> ShowS
$cshowList :: [AuditSuppression] -> ShowS
show :: AuditSuppression -> String
$cshow :: AuditSuppression -> String
showsPrec :: Int -> AuditSuppression -> ShowS
$cshowsPrec :: Int -> AuditSuppression -> ShowS
Prelude.Show, forall x. Rep AuditSuppression x -> AuditSuppression
forall x. AuditSuppression -> Rep AuditSuppression x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AuditSuppression x -> AuditSuppression
$cfrom :: forall x. AuditSuppression -> Rep AuditSuppression x
Prelude.Generic)
newAuditSuppression ::
Prelude.Text ->
ResourceIdentifier ->
AuditSuppression
newAuditSuppression :: Text -> ResourceIdentifier -> AuditSuppression
newAuditSuppression Text
pCheckName_ ResourceIdentifier
pResourceIdentifier_ =
AuditSuppression'
{ $sel:description:AuditSuppression' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:expirationDate:AuditSuppression' :: Maybe POSIX
expirationDate = forall a. Maybe a
Prelude.Nothing,
$sel:suppressIndefinitely:AuditSuppression' :: Maybe Bool
suppressIndefinitely = forall a. Maybe a
Prelude.Nothing,
$sel:checkName:AuditSuppression' :: Text
checkName = Text
pCheckName_,
$sel:resourceIdentifier:AuditSuppression' :: ResourceIdentifier
resourceIdentifier = ResourceIdentifier
pResourceIdentifier_
}
auditSuppression_description :: Lens.Lens' AuditSuppression (Prelude.Maybe Prelude.Text)
auditSuppression_description :: Lens' AuditSuppression (Maybe Text)
auditSuppression_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuditSuppression' {Maybe Text
description :: Maybe Text
$sel:description:AuditSuppression' :: AuditSuppression -> Maybe Text
description} -> Maybe Text
description) (\s :: AuditSuppression
s@AuditSuppression' {} Maybe Text
a -> AuditSuppression
s {$sel:description:AuditSuppression' :: Maybe Text
description = Maybe Text
a} :: AuditSuppression)
auditSuppression_expirationDate :: Lens.Lens' AuditSuppression (Prelude.Maybe Prelude.UTCTime)
auditSuppression_expirationDate :: Lens' AuditSuppression (Maybe UTCTime)
auditSuppression_expirationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuditSuppression' {Maybe POSIX
expirationDate :: Maybe POSIX
$sel:expirationDate:AuditSuppression' :: AuditSuppression -> Maybe POSIX
expirationDate} -> Maybe POSIX
expirationDate) (\s :: AuditSuppression
s@AuditSuppression' {} Maybe POSIX
a -> AuditSuppression
s {$sel:expirationDate:AuditSuppression' :: Maybe POSIX
expirationDate = Maybe POSIX
a} :: AuditSuppression) 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
auditSuppression_suppressIndefinitely :: Lens.Lens' AuditSuppression (Prelude.Maybe Prelude.Bool)
auditSuppression_suppressIndefinitely :: Lens' AuditSuppression (Maybe Bool)
auditSuppression_suppressIndefinitely = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuditSuppression' {Maybe Bool
suppressIndefinitely :: Maybe Bool
$sel:suppressIndefinitely:AuditSuppression' :: AuditSuppression -> Maybe Bool
suppressIndefinitely} -> Maybe Bool
suppressIndefinitely) (\s :: AuditSuppression
s@AuditSuppression' {} Maybe Bool
a -> AuditSuppression
s {$sel:suppressIndefinitely:AuditSuppression' :: Maybe Bool
suppressIndefinitely = Maybe Bool
a} :: AuditSuppression)
auditSuppression_checkName :: Lens.Lens' AuditSuppression Prelude.Text
auditSuppression_checkName :: Lens' AuditSuppression Text
auditSuppression_checkName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuditSuppression' {Text
checkName :: Text
$sel:checkName:AuditSuppression' :: AuditSuppression -> Text
checkName} -> Text
checkName) (\s :: AuditSuppression
s@AuditSuppression' {} Text
a -> AuditSuppression
s {$sel:checkName:AuditSuppression' :: Text
checkName = Text
a} :: AuditSuppression)
auditSuppression_resourceIdentifier :: Lens.Lens' AuditSuppression ResourceIdentifier
auditSuppression_resourceIdentifier :: Lens' AuditSuppression ResourceIdentifier
auditSuppression_resourceIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuditSuppression' {ResourceIdentifier
resourceIdentifier :: ResourceIdentifier
$sel:resourceIdentifier:AuditSuppression' :: AuditSuppression -> ResourceIdentifier
resourceIdentifier} -> ResourceIdentifier
resourceIdentifier) (\s :: AuditSuppression
s@AuditSuppression' {} ResourceIdentifier
a -> AuditSuppression
s {$sel:resourceIdentifier:AuditSuppression' :: ResourceIdentifier
resourceIdentifier = ResourceIdentifier
a} :: AuditSuppression)
instance Data.FromJSON AuditSuppression where
parseJSON :: Value -> Parser AuditSuppression
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AuditSuppression"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Text
-> ResourceIdentifier
-> AuditSuppression
AuditSuppression'
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
"description")
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
"expirationDate")
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
"suppressIndefinitely")
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
"checkName")
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
"resourceIdentifier")
)
instance Prelude.Hashable AuditSuppression where
hashWithSalt :: Int -> AuditSuppression -> Int
hashWithSalt Int
_salt AuditSuppression' {Maybe Bool
Maybe Text
Maybe POSIX
Text
ResourceIdentifier
resourceIdentifier :: ResourceIdentifier
checkName :: Text
suppressIndefinitely :: Maybe Bool
expirationDate :: Maybe POSIX
description :: Maybe Text
$sel:resourceIdentifier:AuditSuppression' :: AuditSuppression -> ResourceIdentifier
$sel:checkName:AuditSuppression' :: AuditSuppression -> Text
$sel:suppressIndefinitely:AuditSuppression' :: AuditSuppression -> Maybe Bool
$sel:expirationDate:AuditSuppression' :: AuditSuppression -> Maybe POSIX
$sel:description:AuditSuppression' :: AuditSuppression -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
expirationDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
suppressIndefinitely
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
checkName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceIdentifier
resourceIdentifier
instance Prelude.NFData AuditSuppression where
rnf :: AuditSuppression -> ()
rnf AuditSuppression' {Maybe Bool
Maybe Text
Maybe POSIX
Text
ResourceIdentifier
resourceIdentifier :: ResourceIdentifier
checkName :: Text
suppressIndefinitely :: Maybe Bool
expirationDate :: Maybe POSIX
description :: Maybe Text
$sel:resourceIdentifier:AuditSuppression' :: AuditSuppression -> ResourceIdentifier
$sel:checkName:AuditSuppression' :: AuditSuppression -> Text
$sel:suppressIndefinitely:AuditSuppression' :: AuditSuppression -> Maybe Bool
$sel:expirationDate:AuditSuppression' :: AuditSuppression -> Maybe POSIX
$sel:description:AuditSuppression' :: AuditSuppression -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
expirationDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
suppressIndefinitely
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
checkName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResourceIdentifier
resourceIdentifier