{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LifecycleHook = LifecycleHook'
{
LifecycleHook -> Maybe Text
defaultResult :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Text
lifecycleHookName :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Int
heartbeatTimeout :: Prelude.Maybe Prelude.Int,
LifecycleHook -> Maybe Text
autoScalingGroupName :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Text
notificationMetadata :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Int
globalTimeout :: Prelude.Maybe Prelude.Int,
LifecycleHook -> Maybe Text
notificationTargetARN :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Text
lifecycleTransition :: Prelude.Maybe Prelude.Text,
LifecycleHook -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text
}
deriving (LifecycleHook -> LifecycleHook -> Bool
(LifecycleHook -> LifecycleHook -> Bool)
-> (LifecycleHook -> LifecycleHook -> Bool) -> Eq LifecycleHook
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]
(Int -> ReadS LifecycleHook)
-> ReadS [LifecycleHook]
-> ReadPrec LifecycleHook
-> ReadPrec [LifecycleHook]
-> Read 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
(Int -> LifecycleHook -> ShowS)
-> (LifecycleHook -> String)
-> ([LifecycleHook] -> ShowS)
-> Show LifecycleHook
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. LifecycleHook -> Rep LifecycleHook x)
-> (forall x. Rep LifecycleHook x -> LifecycleHook)
-> Generic LifecycleHook
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' :: Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook
LifecycleHook'
{ $sel:defaultResult:LifecycleHook' :: Maybe Text
defaultResult = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lifecycleHookName:LifecycleHook' :: Maybe Text
lifecycleHookName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:heartbeatTimeout:LifecycleHook' :: Maybe Int
heartbeatTimeout = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:autoScalingGroupName:LifecycleHook' :: Maybe Text
autoScalingGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:notificationMetadata:LifecycleHook' :: Maybe Text
notificationMetadata = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:globalTimeout:LifecycleHook' :: Maybe Int
globalTimeout = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:notificationTargetARN:LifecycleHook' :: Maybe Text
notificationTargetARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lifecycleTransition:LifecycleHook' :: Maybe Text
lifecycleTransition = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleARN:LifecycleHook' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
lifecycleHook_defaultResult :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_defaultResult :: (Maybe Text -> f (Maybe Text)) -> LifecycleHook -> f LifecycleHook
lifecycleHook_defaultResult = (LifecycleHook -> Maybe Text)
-> (LifecycleHook -> Maybe Text -> LifecycleHook)
-> Lens LifecycleHook LifecycleHook (Maybe Text) (Maybe Text)
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_lifecycleHookName :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_lifecycleHookName :: (Maybe Text -> f (Maybe Text)) -> LifecycleHook -> f LifecycleHook
lifecycleHook_lifecycleHookName = (LifecycleHook -> Maybe Text)
-> (LifecycleHook -> Maybe Text -> LifecycleHook)
-> Lens LifecycleHook LifecycleHook (Maybe Text) (Maybe Text)
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_heartbeatTimeout :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Int)
lifecycleHook_heartbeatTimeout :: (Maybe Int -> f (Maybe Int)) -> LifecycleHook -> f LifecycleHook
lifecycleHook_heartbeatTimeout = (LifecycleHook -> Maybe Int)
-> (LifecycleHook -> Maybe Int -> LifecycleHook)
-> Lens LifecycleHook LifecycleHook (Maybe Int) (Maybe Int)
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_autoScalingGroupName :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_autoScalingGroupName :: (Maybe Text -> f (Maybe Text)) -> LifecycleHook -> f LifecycleHook
lifecycleHook_autoScalingGroupName = (LifecycleHook -> Maybe Text)
-> (LifecycleHook -> Maybe Text -> LifecycleHook)
-> Lens LifecycleHook LifecycleHook (Maybe Text) (Maybe Text)
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_notificationMetadata :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_notificationMetadata :: (Maybe Text -> f (Maybe Text)) -> LifecycleHook -> f LifecycleHook
lifecycleHook_notificationMetadata = (LifecycleHook -> Maybe Text)
-> (LifecycleHook -> Maybe Text -> LifecycleHook)
-> Lens LifecycleHook LifecycleHook (Maybe Text) (Maybe Text)
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_globalTimeout :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Int)
lifecycleHook_globalTimeout :: (Maybe Int -> f (Maybe Int)) -> LifecycleHook -> f LifecycleHook
lifecycleHook_globalTimeout = (LifecycleHook -> Maybe Int)
-> (LifecycleHook -> Maybe Int -> LifecycleHook)
-> Lens LifecycleHook LifecycleHook (Maybe Int) (Maybe Int)
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_notificationTargetARN :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_notificationTargetARN :: (Maybe Text -> f (Maybe Text)) -> LifecycleHook -> f LifecycleHook
lifecycleHook_notificationTargetARN = (LifecycleHook -> Maybe Text)
-> (LifecycleHook -> Maybe Text -> LifecycleHook)
-> Lens LifecycleHook LifecycleHook (Maybe Text) (Maybe Text)
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_lifecycleTransition :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_lifecycleTransition :: (Maybe Text -> f (Maybe Text)) -> LifecycleHook -> f LifecycleHook
lifecycleHook_lifecycleTransition = (LifecycleHook -> Maybe Text)
-> (LifecycleHook -> Maybe Text -> LifecycleHook)
-> Lens LifecycleHook LifecycleHook (Maybe Text) (Maybe Text)
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_roleARN :: Lens.Lens' LifecycleHook (Prelude.Maybe Prelude.Text)
lifecycleHook_roleARN :: (Maybe Text -> f (Maybe Text)) -> LifecycleHook -> f LifecycleHook
lifecycleHook_roleARN = (LifecycleHook -> Maybe Text)
-> (LifecycleHook -> Maybe Text -> LifecycleHook)
-> Lens LifecycleHook LifecycleHook (Maybe Text) (Maybe Text)
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 Core.FromXML LifecycleHook where
parseXML :: [Node] -> Either String LifecycleHook
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook
LifecycleHook'
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DefaultResult")
Either
String
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook)
-> Either String (Maybe Text)
-> Either
String
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LifecycleHookName")
Either
String
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook)
-> Either String (Maybe Int)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HeartbeatTimeout")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AutoScalingGroupName")
Either
String
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LifecycleHook)
-> Either String (Maybe Text)
-> Either
String
(Maybe Int
-> Maybe Text -> Maybe Text -> Maybe Text -> LifecycleHook)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NotificationMetadata")
Either
String
(Maybe Int
-> Maybe Text -> Maybe Text -> Maybe Text -> LifecycleHook)
-> Either String (Maybe Int)
-> Either
String (Maybe Text -> Maybe Text -> Maybe Text -> LifecycleHook)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"GlobalTimeout")
Either
String (Maybe Text -> Maybe Text -> Maybe Text -> LifecycleHook)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Text -> LifecycleHook)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NotificationTargetARN")
Either String (Maybe Text -> Maybe Text -> LifecycleHook)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> LifecycleHook)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LifecycleTransition")
Either String (Maybe Text -> LifecycleHook)
-> Either String (Maybe Text) -> Either String LifecycleHook
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RoleARN")
instance Prelude.Hashable LifecycleHook
instance Prelude.NFData LifecycleHook