{-# 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.OpsWorks.Types.ShutdownEventConfiguration 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 ShutdownEventConfiguration = ShutdownEventConfiguration'
{
ShutdownEventConfiguration -> Maybe Bool
delayUntilElbConnectionsDrained :: Prelude.Maybe Prelude.Bool,
ShutdownEventConfiguration -> Maybe Int
executionTimeout :: Prelude.Maybe Prelude.Int
}
deriving (ShutdownEventConfiguration -> ShutdownEventConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShutdownEventConfiguration -> ShutdownEventConfiguration -> Bool
$c/= :: ShutdownEventConfiguration -> ShutdownEventConfiguration -> Bool
== :: ShutdownEventConfiguration -> ShutdownEventConfiguration -> Bool
$c== :: ShutdownEventConfiguration -> ShutdownEventConfiguration -> Bool
Prelude.Eq, ReadPrec [ShutdownEventConfiguration]
ReadPrec ShutdownEventConfiguration
Int -> ReadS ShutdownEventConfiguration
ReadS [ShutdownEventConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ShutdownEventConfiguration]
$creadListPrec :: ReadPrec [ShutdownEventConfiguration]
readPrec :: ReadPrec ShutdownEventConfiguration
$creadPrec :: ReadPrec ShutdownEventConfiguration
readList :: ReadS [ShutdownEventConfiguration]
$creadList :: ReadS [ShutdownEventConfiguration]
readsPrec :: Int -> ReadS ShutdownEventConfiguration
$creadsPrec :: Int -> ReadS ShutdownEventConfiguration
Prelude.Read, Int -> ShutdownEventConfiguration -> ShowS
[ShutdownEventConfiguration] -> ShowS
ShutdownEventConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShutdownEventConfiguration] -> ShowS
$cshowList :: [ShutdownEventConfiguration] -> ShowS
show :: ShutdownEventConfiguration -> String
$cshow :: ShutdownEventConfiguration -> String
showsPrec :: Int -> ShutdownEventConfiguration -> ShowS
$cshowsPrec :: Int -> ShutdownEventConfiguration -> ShowS
Prelude.Show, forall x.
Rep ShutdownEventConfiguration x -> ShutdownEventConfiguration
forall x.
ShutdownEventConfiguration -> Rep ShutdownEventConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ShutdownEventConfiguration x -> ShutdownEventConfiguration
$cfrom :: forall x.
ShutdownEventConfiguration -> Rep ShutdownEventConfiguration x
Prelude.Generic)
newShutdownEventConfiguration ::
ShutdownEventConfiguration
newShutdownEventConfiguration :: ShutdownEventConfiguration
newShutdownEventConfiguration =
ShutdownEventConfiguration'
{ $sel:delayUntilElbConnectionsDrained:ShutdownEventConfiguration' :: Maybe Bool
delayUntilElbConnectionsDrained =
forall a. Maybe a
Prelude.Nothing,
$sel:executionTimeout:ShutdownEventConfiguration' :: Maybe Int
executionTimeout = forall a. Maybe a
Prelude.Nothing
}
shutdownEventConfiguration_delayUntilElbConnectionsDrained :: Lens.Lens' ShutdownEventConfiguration (Prelude.Maybe Prelude.Bool)
shutdownEventConfiguration_delayUntilElbConnectionsDrained :: Lens' ShutdownEventConfiguration (Maybe Bool)
shutdownEventConfiguration_delayUntilElbConnectionsDrained = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShutdownEventConfiguration' {Maybe Bool
delayUntilElbConnectionsDrained :: Maybe Bool
$sel:delayUntilElbConnectionsDrained:ShutdownEventConfiguration' :: ShutdownEventConfiguration -> Maybe Bool
delayUntilElbConnectionsDrained} -> Maybe Bool
delayUntilElbConnectionsDrained) (\s :: ShutdownEventConfiguration
s@ShutdownEventConfiguration' {} Maybe Bool
a -> ShutdownEventConfiguration
s {$sel:delayUntilElbConnectionsDrained:ShutdownEventConfiguration' :: Maybe Bool
delayUntilElbConnectionsDrained = Maybe Bool
a} :: ShutdownEventConfiguration)
shutdownEventConfiguration_executionTimeout :: Lens.Lens' ShutdownEventConfiguration (Prelude.Maybe Prelude.Int)
shutdownEventConfiguration_executionTimeout :: Lens' ShutdownEventConfiguration (Maybe Int)
shutdownEventConfiguration_executionTimeout = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShutdownEventConfiguration' {Maybe Int
executionTimeout :: Maybe Int
$sel:executionTimeout:ShutdownEventConfiguration' :: ShutdownEventConfiguration -> Maybe Int
executionTimeout} -> Maybe Int
executionTimeout) (\s :: ShutdownEventConfiguration
s@ShutdownEventConfiguration' {} Maybe Int
a -> ShutdownEventConfiguration
s {$sel:executionTimeout:ShutdownEventConfiguration' :: Maybe Int
executionTimeout = Maybe Int
a} :: ShutdownEventConfiguration)
instance Data.FromJSON ShutdownEventConfiguration where
parseJSON :: Value -> Parser ShutdownEventConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ShutdownEventConfiguration"
( \Object
x ->
Maybe Bool -> Maybe Int -> ShutdownEventConfiguration
ShutdownEventConfiguration'
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
"DelayUntilElbConnectionsDrained")
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
"ExecutionTimeout")
)
instance Prelude.Hashable ShutdownEventConfiguration where
hashWithSalt :: Int -> ShutdownEventConfiguration -> Int
hashWithSalt Int
_salt ShutdownEventConfiguration' {Maybe Bool
Maybe Int
executionTimeout :: Maybe Int
delayUntilElbConnectionsDrained :: Maybe Bool
$sel:executionTimeout:ShutdownEventConfiguration' :: ShutdownEventConfiguration -> Maybe Int
$sel:delayUntilElbConnectionsDrained:ShutdownEventConfiguration' :: ShutdownEventConfiguration -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
delayUntilElbConnectionsDrained
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
executionTimeout
instance Prelude.NFData ShutdownEventConfiguration where
rnf :: ShutdownEventConfiguration -> ()
rnf ShutdownEventConfiguration' {Maybe Bool
Maybe Int
executionTimeout :: Maybe Int
delayUntilElbConnectionsDrained :: Maybe Bool
$sel:executionTimeout:ShutdownEventConfiguration' :: ShutdownEventConfiguration -> Maybe Int
$sel:delayUntilElbConnectionsDrained:ShutdownEventConfiguration' :: ShutdownEventConfiguration -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
delayUntilElbConnectionsDrained
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
executionTimeout
instance Data.ToJSON ShutdownEventConfiguration where
toJSON :: ShutdownEventConfiguration -> Value
toJSON ShutdownEventConfiguration' {Maybe Bool
Maybe Int
executionTimeout :: Maybe Int
delayUntilElbConnectionsDrained :: Maybe Bool
$sel:executionTimeout:ShutdownEventConfiguration' :: ShutdownEventConfiguration -> Maybe Int
$sel:delayUntilElbConnectionsDrained:ShutdownEventConfiguration' :: ShutdownEventConfiguration -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DelayUntilElbConnectionsDrained" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
delayUntilElbConnectionsDrained,
(Key
"ExecutionTimeout" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
executionTimeout
]
)