{-# 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.AutoScaling.Types.LifecycleHook 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 LifecycleHook = LifecycleHook'
{
LifecycleHook -> Maybe Text
autoScalingGroupName :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Text
defaultResult :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Int
globalTimeout :: Prelude.Maybe Prelude.Int,
LifecycleHook -> Maybe Int
heartbeatTimeout :: Prelude.Maybe Prelude.Int,
LifecycleHook -> Maybe Text
lifecycleHookName :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Text
lifecycleTransition :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Text
notificationMetadata :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Text
notificationTargetARN :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text
}
deriving (LifecycleHook -> LifecycleHook -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LifecycleHook -> LifecycleHook -> Bool
$c/= :: LifecycleHook -> LifecycleHook -> Bool
== :: LifecycleHook -> LifecycleHook -> Bool
$c== :: LifecycleHook -> LifecycleHook -> Bool
Prelude.Eq, ReadPrec [LifecycleHook]
ReadPrec LifecycleHook
Int -> ReadS LifecycleHook
ReadS [LifecycleHook]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LifecycleHook]
$creadListPrec :: ReadPrec [LifecycleHook]
readPrec :: ReadPrec LifecycleHook
$creadPrec :: ReadPrec LifecycleHook
readList :: ReadS [LifecycleHook]
$creadList :: ReadS [LifecycleHook]
readsPrec :: Int -> ReadS LifecycleHook
$creadsPrec :: Int -> ReadS LifecycleHook
Prelude.Read, Int -> LifecycleHook -> ShowS
[LifecycleHook] -> ShowS
LifecycleHook -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LifecycleHook] -> ShowS
$cshowList :: [LifecycleHook] -> ShowS
show :: LifecycleHook -> String
$cshow :: LifecycleHook -> String
showsPrec :: Int -> LifecycleHook -> ShowS
$cshowsPrec :: Int -> LifecycleHook -> ShowS
Prelude.Show, forall x. Rep LifecycleHook x -> LifecycleHook
forall x. LifecycleHook -> Rep LifecycleHook x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LifecycleHook x -> LifecycleHook
$cfrom :: forall x. LifecycleHook -> Rep LifecycleHook x
Prelude.Generic)
newLifecycleHook ::
LifecycleHook
newLifecycleHook :: LifecycleHook
newLifecycleHook =
LifecycleHook'
{ $sel:autoScalingGroupName:LifecycleHook' :: Maybe Text
autoScalingGroupName =
forall a. Maybe a
Prelude.Nothing,
$sel:defaultResult:LifecycleHook' :: Maybe Text
defaultResult = forall a. Maybe a
Prelude.Nothing,
$sel:globalTimeout:LifecycleHook' :: Maybe Int
globalTimeout = forall a. Maybe a
Prelude.Nothing,
$sel:heartbeatTimeout:LifecycleHook' :: Maybe Int
heartbeatTimeout = forall a. Maybe a
Prelude.Nothing,
$sel:lifecycleHookName:LifecycleHook' :: Maybe Text
lifecycleHookName = forall a. Maybe a
Prelude.Nothing,
$sel:lifecycleTransition:LifecycleHook' :: Maybe Text
lifecycleTransition = forall a. Maybe a
Prelude.Nothing,
$sel:notificationMetadata:LifecycleHook' :: Maybe Text
notificationMetadata = forall a. Maybe a
Prelude.Nothing,
$sel:notificationTargetARN:LifecycleHook' :: Maybe Text
notificationTargetARN = forall a. Maybe a
Prelude.Nothing,
$sel:roleARN:LifecycleHook' :: Maybe Text
roleARN = forall a. Maybe a
Prelude.Nothing
}
lifecycleHook_autoScalingGroupName :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_autoScalingGroupName :: Lens' LifecycleHook (Maybe Text)
lifecycleHook_autoScalingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleHook' {Maybe Text
autoScalingGroupName :: Maybe Text
$sel:autoScalingGroupName:LifecycleHook' :: LifecycleHook -> Maybe Text
autoScalingGroupName} -> Maybe Text
autoScalingGroupName) (\s :: LifecycleHook
s@LifecycleHook' {} Maybe Text
a -> LifecycleHook
s {$sel:autoScalingGroupName:LifecycleHook' :: Maybe Text
autoScalingGroupName = Maybe Text
a} :: LifecycleHook)
lifecycleHook_defaultResult :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_defaultResult :: Lens' LifecycleHook (Maybe Text)
lifecycleHook_defaultResult = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleHook' {Maybe Text
defaultResult :: Maybe Text
$sel:defaultResult:LifecycleHook' :: LifecycleHook -> Maybe Text
defaultResult} -> Maybe Text
defaultResult) (\s :: LifecycleHook
s@LifecycleHook' {} Maybe Text
a -> LifecycleHook
s {$sel:defaultResult:LifecycleHook' :: Maybe Text
defaultResult = Maybe Text
a} :: LifecycleHook)
lifecycleHook_globalTimeout :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Int)
lifecycleHook_globalTimeout :: Lens' LifecycleHook (Maybe Int)
lifecycleHook_globalTimeout = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleHook' {Maybe Int
globalTimeout :: Maybe Int
$sel:globalTimeout:LifecycleHook' :: LifecycleHook -> Maybe Int
globalTimeout} -> Maybe Int
globalTimeout) (\s :: LifecycleHook
s@LifecycleHook' {} Maybe Int
a -> LifecycleHook
s {$sel:globalTimeout:LifecycleHook' :: Maybe Int
globalTimeout = Maybe Int
a} :: LifecycleHook)
lifecycleHook_heartbeatTimeout :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Int)
lifecycleHook_heartbeatTimeout :: Lens' LifecycleHook (Maybe Int)
lifecycleHook_heartbeatTimeout = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleHook' {Maybe Int
heartbeatTimeout :: Maybe Int
$sel:heartbeatTimeout:LifecycleHook' :: LifecycleHook -> Maybe Int
heartbeatTimeout} -> Maybe Int
heartbeatTimeout) (\s :: LifecycleHook
s@LifecycleHook' {} Maybe Int
a -> LifecycleHook
s {$sel:heartbeatTimeout:LifecycleHook' :: Maybe Int
heartbeatTimeout = Maybe Int
a} :: LifecycleHook)
lifecycleHook_lifecycleHookName :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_lifecycleHookName :: Lens' LifecycleHook (Maybe Text)
lifecycleHook_lifecycleHookName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleHook' {Maybe Text
lifecycleHookName :: Maybe Text
$sel:lifecycleHookName:LifecycleHook' :: LifecycleHook -> Maybe Text
lifecycleHookName} -> Maybe Text
lifecycleHookName) (\s :: LifecycleHook
s@LifecycleHook' {} Maybe Text
a -> LifecycleHook
s {$sel:lifecycleHookName:LifecycleHook' :: Maybe Text
lifecycleHookName = Maybe Text
a} :: LifecycleHook)
lifecycleHook_lifecycleTransition :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_lifecycleTransition :: Lens' LifecycleHook (Maybe Text)
lifecycleHook_lifecycleTransition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleHook' {Maybe Text
lifecycleTransition :: Maybe Text
$sel:lifecycleTransition:LifecycleHook' :: LifecycleHook -> Maybe Text
lifecycleTransition} -> Maybe Text
lifecycleTransition) (\s :: LifecycleHook
s@LifecycleHook' {} Maybe Text
a -> LifecycleHook
s {$sel:lifecycleTransition:LifecycleHook' :: Maybe Text
lifecycleTransition = Maybe Text
a} :: LifecycleHook)
lifecycleHook_notificationMetadata :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_notificationMetadata :: Lens' LifecycleHook (Maybe Text)
lifecycleHook_notificationMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleHook' {Maybe Text
notificationMetadata :: Maybe Text
$sel:notificationMetadata:LifecycleHook' :: LifecycleHook -> Maybe Text
notificationMetadata} -> Maybe Text
notificationMetadata) (\s :: LifecycleHook
s@LifecycleHook' {} Maybe Text
a -> LifecycleHook
s {$sel:notificationMetadata:LifecycleHook' :: Maybe Text
notificationMetadata = Maybe Text
a} :: LifecycleHook)
lifecycleHook_notificationTargetARN :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_notificationTargetARN :: Lens' LifecycleHook (Maybe Text)
lifecycleHook_notificationTargetARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleHook' {Maybe Text
notificationTargetARN :: Maybe Text
$sel:notificationTargetARN:LifecycleHook' :: LifecycleHook -> Maybe Text
notificationTargetARN} -> Maybe Text
notificationTargetARN) (\s :: LifecycleHook
s@LifecycleHook' {} Maybe Text
a -> LifecycleHook
s {$sel:notificationTargetARN:LifecycleHook' :: Maybe Text
notificationTargetARN = Maybe Text
a} :: LifecycleHook)
lifecycleHook_roleARN :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_roleARN :: Lens' LifecycleHook (Maybe Text)
lifecycleHook_roleARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleHook' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:LifecycleHook' :: LifecycleHook -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: LifecycleHook
s@LifecycleHook' {} Maybe Text
a -> LifecycleHook
s {$sel:roleARN:LifecycleHook' :: Maybe Text
roleARN = Maybe Text
a} :: LifecycleHook)
instance Data.FromXML LifecycleHook where
parseXML :: [Node] -> Either String LifecycleHook
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook
LifecycleHook'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AutoScalingGroupName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DefaultResult")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"GlobalTimeout")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"HeartbeatTimeout")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"LifecycleHookName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"LifecycleTransition")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"NotificationMetadata")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"NotificationTargetARN")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"RoleARN")
instance Prelude.Hashable LifecycleHook where
hashWithSalt :: Int -> LifecycleHook -> Int
hashWithSalt Int
_salt LifecycleHook' {Maybe Int
Maybe Text
roleARN :: Maybe Text
notificationTargetARN :: Maybe Text
notificationMetadata :: Maybe Text
lifecycleTransition :: Maybe Text
lifecycleHookName :: Maybe Text
heartbeatTimeout :: Maybe Int
globalTimeout :: Maybe Int
defaultResult :: Maybe Text
autoScalingGroupName :: Maybe Text
$sel:roleARN:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:notificationTargetARN:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:notificationMetadata:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:lifecycleTransition:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:lifecycleHookName:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:heartbeatTimeout:LifecycleHook' :: LifecycleHook -> Maybe Int
$sel:globalTimeout:LifecycleHook' :: LifecycleHook -> Maybe Int
$sel:defaultResult:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:autoScalingGroupName:LifecycleHook' :: LifecycleHook -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
autoScalingGroupName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultResult
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
globalTimeout
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
heartbeatTimeout
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lifecycleHookName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lifecycleTransition
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notificationMetadata
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notificationTargetARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleARN
instance Prelude.NFData LifecycleHook where
rnf :: LifecycleHook -> ()
rnf LifecycleHook' {Maybe Int
Maybe Text
roleARN :: Maybe Text
notificationTargetARN :: Maybe Text
notificationMetadata :: Maybe Text
lifecycleTransition :: Maybe Text
lifecycleHookName :: Maybe Text
heartbeatTimeout :: Maybe Int
globalTimeout :: Maybe Int
defaultResult :: Maybe Text
autoScalingGroupName :: Maybe Text
$sel:roleARN:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:notificationTargetARN:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:notificationMetadata:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:lifecycleTransition:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:lifecycleHookName:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:heartbeatTimeout:LifecycleHook' :: LifecycleHook -> Maybe Int
$sel:globalTimeout:LifecycleHook' :: LifecycleHook -> Maybe Int
$sel:defaultResult:LifecycleHook' :: LifecycleHook -> Maybe Text
$sel:autoScalingGroupName:LifecycleHook' :: LifecycleHook -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
autoScalingGroupName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultResult
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
globalTimeout
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
heartbeatTimeout
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lifecycleHookName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lifecycleTransition
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notificationMetadata
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notificationTargetARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleARN