{-# 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.WAFV2.Types.ManagedRuleGroupVersion 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 ManagedRuleGroupVersion = ManagedRuleGroupVersion'
{
ManagedRuleGroupVersion -> Maybe POSIX
lastUpdateTimestamp :: Prelude.Maybe Data.POSIX,
ManagedRuleGroupVersion -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (ManagedRuleGroupVersion -> ManagedRuleGroupVersion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManagedRuleGroupVersion -> ManagedRuleGroupVersion -> Bool
$c/= :: ManagedRuleGroupVersion -> ManagedRuleGroupVersion -> Bool
== :: ManagedRuleGroupVersion -> ManagedRuleGroupVersion -> Bool
$c== :: ManagedRuleGroupVersion -> ManagedRuleGroupVersion -> Bool
Prelude.Eq, ReadPrec [ManagedRuleGroupVersion]
ReadPrec ManagedRuleGroupVersion
Int -> ReadS ManagedRuleGroupVersion
ReadS [ManagedRuleGroupVersion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManagedRuleGroupVersion]
$creadListPrec :: ReadPrec [ManagedRuleGroupVersion]
readPrec :: ReadPrec ManagedRuleGroupVersion
$creadPrec :: ReadPrec ManagedRuleGroupVersion
readList :: ReadS [ManagedRuleGroupVersion]
$creadList :: ReadS [ManagedRuleGroupVersion]
readsPrec :: Int -> ReadS ManagedRuleGroupVersion
$creadsPrec :: Int -> ReadS ManagedRuleGroupVersion
Prelude.Read, Int -> ManagedRuleGroupVersion -> ShowS
[ManagedRuleGroupVersion] -> ShowS
ManagedRuleGroupVersion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManagedRuleGroupVersion] -> ShowS
$cshowList :: [ManagedRuleGroupVersion] -> ShowS
show :: ManagedRuleGroupVersion -> String
$cshow :: ManagedRuleGroupVersion -> String
showsPrec :: Int -> ManagedRuleGroupVersion -> ShowS
$cshowsPrec :: Int -> ManagedRuleGroupVersion -> ShowS
Prelude.Show, forall x. Rep ManagedRuleGroupVersion x -> ManagedRuleGroupVersion
forall x. ManagedRuleGroupVersion -> Rep ManagedRuleGroupVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ManagedRuleGroupVersion x -> ManagedRuleGroupVersion
$cfrom :: forall x. ManagedRuleGroupVersion -> Rep ManagedRuleGroupVersion x
Prelude.Generic)
newManagedRuleGroupVersion ::
ManagedRuleGroupVersion
newManagedRuleGroupVersion :: ManagedRuleGroupVersion
newManagedRuleGroupVersion =
ManagedRuleGroupVersion'
{ $sel:lastUpdateTimestamp:ManagedRuleGroupVersion' :: Maybe POSIX
lastUpdateTimestamp =
forall a. Maybe a
Prelude.Nothing,
$sel:name:ManagedRuleGroupVersion' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
}
managedRuleGroupVersion_lastUpdateTimestamp :: Lens.Lens' ManagedRuleGroupVersion (Prelude.Maybe Prelude.UTCTime)
managedRuleGroupVersion_lastUpdateTimestamp :: Lens' ManagedRuleGroupVersion (Maybe UTCTime)
managedRuleGroupVersion_lastUpdateTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupVersion' {Maybe POSIX
lastUpdateTimestamp :: Maybe POSIX
$sel:lastUpdateTimestamp:ManagedRuleGroupVersion' :: ManagedRuleGroupVersion -> Maybe POSIX
lastUpdateTimestamp} -> Maybe POSIX
lastUpdateTimestamp) (\s :: ManagedRuleGroupVersion
s@ManagedRuleGroupVersion' {} Maybe POSIX
a -> ManagedRuleGroupVersion
s {$sel:lastUpdateTimestamp:ManagedRuleGroupVersion' :: Maybe POSIX
lastUpdateTimestamp = Maybe POSIX
a} :: ManagedRuleGroupVersion) 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
managedRuleGroupVersion_name :: Lens.Lens' ManagedRuleGroupVersion (Prelude.Maybe Prelude.Text)
managedRuleGroupVersion_name :: Lens' ManagedRuleGroupVersion (Maybe Text)
managedRuleGroupVersion_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupVersion' {Maybe Text
name :: Maybe Text
$sel:name:ManagedRuleGroupVersion' :: ManagedRuleGroupVersion -> Maybe Text
name} -> Maybe Text
name) (\s :: ManagedRuleGroupVersion
s@ManagedRuleGroupVersion' {} Maybe Text
a -> ManagedRuleGroupVersion
s {$sel:name:ManagedRuleGroupVersion' :: Maybe Text
name = Maybe Text
a} :: ManagedRuleGroupVersion)
instance Data.FromJSON ManagedRuleGroupVersion where
parseJSON :: Value -> Parser ManagedRuleGroupVersion
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ManagedRuleGroupVersion"
( \Object
x ->
Maybe POSIX -> Maybe Text -> ManagedRuleGroupVersion
ManagedRuleGroupVersion'
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
"LastUpdateTimestamp")
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
"Name")
)
instance Prelude.Hashable ManagedRuleGroupVersion where
hashWithSalt :: Int -> ManagedRuleGroupVersion -> Int
hashWithSalt Int
_salt ManagedRuleGroupVersion' {Maybe Text
Maybe POSIX
name :: Maybe Text
lastUpdateTimestamp :: Maybe POSIX
$sel:name:ManagedRuleGroupVersion' :: ManagedRuleGroupVersion -> Maybe Text
$sel:lastUpdateTimestamp:ManagedRuleGroupVersion' :: ManagedRuleGroupVersion -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdateTimestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
instance Prelude.NFData ManagedRuleGroupVersion where
rnf :: ManagedRuleGroupVersion -> ()
rnf ManagedRuleGroupVersion' {Maybe Text
Maybe POSIX
name :: Maybe Text
lastUpdateTimestamp :: Maybe POSIX
$sel:name:ManagedRuleGroupVersion' :: ManagedRuleGroupVersion -> Maybe Text
$sel:lastUpdateTimestamp:ManagedRuleGroupVersion' :: ManagedRuleGroupVersion -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdateTimestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name