{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AutoScaling.Types.LifecycleHook
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AutoScaling.Types.LifecycleHook where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes a lifecycle hook, which tells Amazon EC2 Auto Scaling that you
-- want to perform an action whenever it launches instances or terminates
-- instances.
--
-- /See:/ 'newLifecycleHook' smart constructor.
data LifecycleHook = LifecycleHook'
  { -- | Defines the action the Auto Scaling group should take when the lifecycle
    -- hook timeout elapses or if an unexpected failure occurs. The possible
    -- values are @CONTINUE@ and @ABANDON@.
    LifecycleHook -> Maybe Text
defaultResult :: Prelude.Maybe Prelude.Text,
    -- | The name of the lifecycle hook.
    LifecycleHook -> Maybe Text
lifecycleHookName :: Prelude.Maybe Prelude.Text,
    -- | The maximum time, in seconds, that can elapse before the lifecycle hook
    -- times out. If the lifecycle hook times out, Amazon EC2 Auto Scaling
    -- performs the action that you specified in the @DefaultResult@ parameter.
    LifecycleHook -> Maybe Int
heartbeatTimeout :: Prelude.Maybe Prelude.Int,
    -- | The name of the Auto Scaling group for the lifecycle hook.
    LifecycleHook -> Maybe Text
autoScalingGroupName :: Prelude.Maybe Prelude.Text,
    -- | Additional information that is included any time Amazon EC2 Auto Scaling
    -- sends a message to the notification target.
    LifecycleHook -> Maybe Text
notificationMetadata :: Prelude.Maybe Prelude.Text,
    -- | The maximum time, in seconds, that an instance can remain in a
    -- @Pending:Wait@ or @Terminating:Wait@ state. The maximum is 172800
    -- seconds (48 hours) or 100 times @HeartbeatTimeout@, whichever is
    -- smaller.
    LifecycleHook -> Maybe Int
globalTimeout :: Prelude.Maybe Prelude.Int,
    -- | The ARN of the target that Amazon EC2 Auto Scaling sends notifications
    -- to when an instance is in the transition state for the lifecycle hook.
    -- The notification target can be either an SQS queue or an SNS topic.
    LifecycleHook -> Maybe Text
notificationTargetARN :: Prelude.Maybe Prelude.Text,
    -- | The state of the EC2 instance to which to attach the lifecycle hook. The
    -- following are possible values:
    --
    -- -   autoscaling:EC2_INSTANCE_LAUNCHING
    --
    -- -   autoscaling:EC2_INSTANCE_TERMINATING
    LifecycleHook -> Maybe Text
lifecycleTransition :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the IAM role that allows the Auto Scaling group to publish to
    -- the specified notification target.
    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)

-- |
-- Create a value of 'LifecycleHook' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'defaultResult', 'lifecycleHook_defaultResult' - Defines the action the Auto Scaling group should take when the lifecycle
-- hook timeout elapses or if an unexpected failure occurs. The possible
-- values are @CONTINUE@ and @ABANDON@.
--
-- 'lifecycleHookName', 'lifecycleHook_lifecycleHookName' - The name of the lifecycle hook.
--
-- 'heartbeatTimeout', 'lifecycleHook_heartbeatTimeout' - The maximum time, in seconds, that can elapse before the lifecycle hook
-- times out. If the lifecycle hook times out, Amazon EC2 Auto Scaling
-- performs the action that you specified in the @DefaultResult@ parameter.
--
-- 'autoScalingGroupName', 'lifecycleHook_autoScalingGroupName' - The name of the Auto Scaling group for the lifecycle hook.
--
-- 'notificationMetadata', 'lifecycleHook_notificationMetadata' - Additional information that is included any time Amazon EC2 Auto Scaling
-- sends a message to the notification target.
--
-- 'globalTimeout', 'lifecycleHook_globalTimeout' - The maximum time, in seconds, that an instance can remain in a
-- @Pending:Wait@ or @Terminating:Wait@ state. The maximum is 172800
-- seconds (48 hours) or 100 times @HeartbeatTimeout@, whichever is
-- smaller.
--
-- 'notificationTargetARN', 'lifecycleHook_notificationTargetARN' - The ARN of the target that Amazon EC2 Auto Scaling sends notifications
-- to when an instance is in the transition state for the lifecycle hook.
-- The notification target can be either an SQS queue or an SNS topic.
--
-- 'lifecycleTransition', 'lifecycleHook_lifecycleTransition' - The state of the EC2 instance to which to attach the lifecycle hook. The
-- following are possible values:
--
-- -   autoscaling:EC2_INSTANCE_LAUNCHING
--
-- -   autoscaling:EC2_INSTANCE_TERMINATING
--
-- 'roleARN', 'lifecycleHook_roleARN' - The ARN of the IAM role that allows the Auto Scaling group to publish to
-- the specified notification target.
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
    }

-- | Defines the action the Auto Scaling group should take when the lifecycle
-- hook timeout elapses or if an unexpected failure occurs. The possible
-- values are @CONTINUE@ and @ABANDON@.
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)

-- | The name of the lifecycle hook.
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)

-- | The maximum time, in seconds, that can elapse before the lifecycle hook
-- times out. If the lifecycle hook times out, Amazon EC2 Auto Scaling
-- performs the action that you specified in the @DefaultResult@ parameter.
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)

-- | The name of the Auto Scaling group for the lifecycle hook.
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)

-- | Additional information that is included any time Amazon EC2 Auto Scaling
-- sends a message to the notification target.
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)

-- | The maximum time, in seconds, that an instance can remain in a
-- @Pending:Wait@ or @Terminating:Wait@ state. The maximum is 172800
-- seconds (48 hours) or 100 times @HeartbeatTimeout@, whichever is
-- smaller.
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)

-- | The ARN of the target that Amazon EC2 Auto Scaling sends notifications
-- to when an instance is in the transition state for the lifecycle hook.
-- The notification target can be either an SQS queue or an SNS topic.
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)

-- | The state of the EC2 instance to which to attach the lifecycle hook. The
-- following are possible values:
--
-- -   autoscaling:EC2_INSTANCE_LAUNCHING
--
-- -   autoscaling:EC2_INSTANCE_TERMINATING
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)

-- | The ARN of the IAM role that allows the Auto Scaling group to publish to
-- the specified notification target.
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