{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.AutoScaling.CompleteLifecycleAction
(
CompleteLifecycleAction (..),
newCompleteLifecycleAction,
completeLifecycleAction_instanceId,
completeLifecycleAction_lifecycleActionToken,
completeLifecycleAction_lifecycleHookName,
completeLifecycleAction_autoScalingGroupName,
completeLifecycleAction_lifecycleActionResult,
CompleteLifecycleActionResponse (..),
newCompleteLifecycleActionResponse,
completeLifecycleActionResponse_httpStatus,
)
where
import Amazonka.AutoScaling.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CompleteLifecycleAction = CompleteLifecycleAction'
{
CompleteLifecycleAction -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
CompleteLifecycleAction -> Maybe Text
lifecycleActionToken :: Prelude.Maybe Prelude.Text,
CompleteLifecycleAction -> Text
lifecycleHookName :: Prelude.Text,
CompleteLifecycleAction -> Text
autoScalingGroupName :: Prelude.Text,
CompleteLifecycleAction -> Text
lifecycleActionResult :: Prelude.Text
}
deriving (CompleteLifecycleAction -> CompleteLifecycleAction -> Bool
(CompleteLifecycleAction -> CompleteLifecycleAction -> Bool)
-> (CompleteLifecycleAction -> CompleteLifecycleAction -> Bool)
-> Eq CompleteLifecycleAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompleteLifecycleAction -> CompleteLifecycleAction -> Bool
$c/= :: CompleteLifecycleAction -> CompleteLifecycleAction -> Bool
== :: CompleteLifecycleAction -> CompleteLifecycleAction -> Bool
$c== :: CompleteLifecycleAction -> CompleteLifecycleAction -> Bool
Prelude.Eq, ReadPrec [CompleteLifecycleAction]
ReadPrec CompleteLifecycleAction
Int -> ReadS CompleteLifecycleAction
ReadS [CompleteLifecycleAction]
(Int -> ReadS CompleteLifecycleAction)
-> ReadS [CompleteLifecycleAction]
-> ReadPrec CompleteLifecycleAction
-> ReadPrec [CompleteLifecycleAction]
-> Read CompleteLifecycleAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompleteLifecycleAction]
$creadListPrec :: ReadPrec [CompleteLifecycleAction]
readPrec :: ReadPrec CompleteLifecycleAction
$creadPrec :: ReadPrec CompleteLifecycleAction
readList :: ReadS [CompleteLifecycleAction]
$creadList :: ReadS [CompleteLifecycleAction]
readsPrec :: Int -> ReadS CompleteLifecycleAction
$creadsPrec :: Int -> ReadS CompleteLifecycleAction
Prelude.Read, Int -> CompleteLifecycleAction -> ShowS
[CompleteLifecycleAction] -> ShowS
CompleteLifecycleAction -> String
(Int -> CompleteLifecycleAction -> ShowS)
-> (CompleteLifecycleAction -> String)
-> ([CompleteLifecycleAction] -> ShowS)
-> Show CompleteLifecycleAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompleteLifecycleAction] -> ShowS
$cshowList :: [CompleteLifecycleAction] -> ShowS
show :: CompleteLifecycleAction -> String
$cshow :: CompleteLifecycleAction -> String
showsPrec :: Int -> CompleteLifecycleAction -> ShowS
$cshowsPrec :: Int -> CompleteLifecycleAction -> ShowS
Prelude.Show, (forall x.
CompleteLifecycleAction -> Rep CompleteLifecycleAction x)
-> (forall x.
Rep CompleteLifecycleAction x -> CompleteLifecycleAction)
-> Generic CompleteLifecycleAction
forall x. Rep CompleteLifecycleAction x -> CompleteLifecycleAction
forall x. CompleteLifecycleAction -> Rep CompleteLifecycleAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompleteLifecycleAction x -> CompleteLifecycleAction
$cfrom :: forall x. CompleteLifecycleAction -> Rep CompleteLifecycleAction x
Prelude.Generic)
newCompleteLifecycleAction ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CompleteLifecycleAction
newCompleteLifecycleAction :: Text -> Text -> Text -> CompleteLifecycleAction
newCompleteLifecycleAction
Text
pLifecycleHookName_
Text
pAutoScalingGroupName_
Text
pLifecycleActionResult_ =
CompleteLifecycleAction' :: Maybe Text
-> Maybe Text -> Text -> Text -> Text -> CompleteLifecycleAction
CompleteLifecycleAction'
{ $sel:instanceId:CompleteLifecycleAction' :: Maybe Text
instanceId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lifecycleActionToken:CompleteLifecycleAction' :: Maybe Text
lifecycleActionToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lifecycleHookName:CompleteLifecycleAction' :: Text
lifecycleHookName = Text
pLifecycleHookName_,
$sel:autoScalingGroupName:CompleteLifecycleAction' :: Text
autoScalingGroupName = Text
pAutoScalingGroupName_,
$sel:lifecycleActionResult:CompleteLifecycleAction' :: Text
lifecycleActionResult = Text
pLifecycleActionResult_
}
completeLifecycleAction_instanceId :: Lens.Lens' CompleteLifecycleAction (Prelude.Maybe Prelude.Text)
completeLifecycleAction_instanceId :: (Maybe Text -> f (Maybe Text))
-> CompleteLifecycleAction -> f CompleteLifecycleAction
completeLifecycleAction_instanceId = (CompleteLifecycleAction -> Maybe Text)
-> (CompleteLifecycleAction
-> Maybe Text -> CompleteLifecycleAction)
-> Lens
CompleteLifecycleAction
CompleteLifecycleAction
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteLifecycleAction' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:CompleteLifecycleAction' :: CompleteLifecycleAction -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: CompleteLifecycleAction
s@CompleteLifecycleAction' {} Maybe Text
a -> CompleteLifecycleAction
s {$sel:instanceId:CompleteLifecycleAction' :: Maybe Text
instanceId = Maybe Text
a} :: CompleteLifecycleAction)
completeLifecycleAction_lifecycleActionToken :: Lens.Lens' CompleteLifecycleAction (Prelude.Maybe Prelude.Text)
completeLifecycleAction_lifecycleActionToken :: (Maybe Text -> f (Maybe Text))
-> CompleteLifecycleAction -> f CompleteLifecycleAction
completeLifecycleAction_lifecycleActionToken = (CompleteLifecycleAction -> Maybe Text)
-> (CompleteLifecycleAction
-> Maybe Text -> CompleteLifecycleAction)
-> Lens
CompleteLifecycleAction
CompleteLifecycleAction
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteLifecycleAction' {Maybe Text
lifecycleActionToken :: Maybe Text
$sel:lifecycleActionToken:CompleteLifecycleAction' :: CompleteLifecycleAction -> Maybe Text
lifecycleActionToken} -> Maybe Text
lifecycleActionToken) (\s :: CompleteLifecycleAction
s@CompleteLifecycleAction' {} Maybe Text
a -> CompleteLifecycleAction
s {$sel:lifecycleActionToken:CompleteLifecycleAction' :: Maybe Text
lifecycleActionToken = Maybe Text
a} :: CompleteLifecycleAction)
completeLifecycleAction_lifecycleHookName :: Lens.Lens' CompleteLifecycleAction Prelude.Text
completeLifecycleAction_lifecycleHookName :: (Text -> f Text)
-> CompleteLifecycleAction -> f CompleteLifecycleAction
completeLifecycleAction_lifecycleHookName = (CompleteLifecycleAction -> Text)
-> (CompleteLifecycleAction -> Text -> CompleteLifecycleAction)
-> Lens CompleteLifecycleAction CompleteLifecycleAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteLifecycleAction' {Text
lifecycleHookName :: Text
$sel:lifecycleHookName:CompleteLifecycleAction' :: CompleteLifecycleAction -> Text
lifecycleHookName} -> Text
lifecycleHookName) (\s :: CompleteLifecycleAction
s@CompleteLifecycleAction' {} Text
a -> CompleteLifecycleAction
s {$sel:lifecycleHookName:CompleteLifecycleAction' :: Text
lifecycleHookName = Text
a} :: CompleteLifecycleAction)
completeLifecycleAction_autoScalingGroupName :: Lens.Lens' CompleteLifecycleAction Prelude.Text
completeLifecycleAction_autoScalingGroupName :: (Text -> f Text)
-> CompleteLifecycleAction -> f CompleteLifecycleAction
completeLifecycleAction_autoScalingGroupName = (CompleteLifecycleAction -> Text)
-> (CompleteLifecycleAction -> Text -> CompleteLifecycleAction)
-> Lens CompleteLifecycleAction CompleteLifecycleAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteLifecycleAction' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:CompleteLifecycleAction' :: CompleteLifecycleAction -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: CompleteLifecycleAction
s@CompleteLifecycleAction' {} Text
a -> CompleteLifecycleAction
s {$sel:autoScalingGroupName:CompleteLifecycleAction' :: Text
autoScalingGroupName = Text
a} :: CompleteLifecycleAction)
completeLifecycleAction_lifecycleActionResult :: Lens.Lens' CompleteLifecycleAction Prelude.Text
completeLifecycleAction_lifecycleActionResult :: (Text -> f Text)
-> CompleteLifecycleAction -> f CompleteLifecycleAction
completeLifecycleAction_lifecycleActionResult = (CompleteLifecycleAction -> Text)
-> (CompleteLifecycleAction -> Text -> CompleteLifecycleAction)
-> Lens CompleteLifecycleAction CompleteLifecycleAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteLifecycleAction' {Text
lifecycleActionResult :: Text
$sel:lifecycleActionResult:CompleteLifecycleAction' :: CompleteLifecycleAction -> Text
lifecycleActionResult} -> Text
lifecycleActionResult) (\s :: CompleteLifecycleAction
s@CompleteLifecycleAction' {} Text
a -> CompleteLifecycleAction
s {$sel:lifecycleActionResult:CompleteLifecycleAction' :: Text
lifecycleActionResult = Text
a} :: CompleteLifecycleAction)
instance Core.AWSRequest CompleteLifecycleAction where
type
AWSResponse CompleteLifecycleAction =
CompleteLifecycleActionResponse
request :: CompleteLifecycleAction -> Request CompleteLifecycleAction
request = Service
-> CompleteLifecycleAction -> Request CompleteLifecycleAction
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CompleteLifecycleAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CompleteLifecycleAction)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CompleteLifecycleAction))
-> Logger
-> Service
-> Proxy CompleteLifecycleAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CompleteLifecycleAction)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"CompleteLifecycleActionResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> CompleteLifecycleActionResponse
CompleteLifecycleActionResponse'
(Int -> CompleteLifecycleActionResponse)
-> Either String Int
-> Either String CompleteLifecycleActionResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CompleteLifecycleAction
instance Prelude.NFData CompleteLifecycleAction
instance Core.ToHeaders CompleteLifecycleAction where
toHeaders :: CompleteLifecycleAction -> ResponseHeaders
toHeaders = ResponseHeaders -> CompleteLifecycleAction -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CompleteLifecycleAction where
toPath :: CompleteLifecycleAction -> ByteString
toPath = ByteString -> CompleteLifecycleAction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CompleteLifecycleAction where
toQuery :: CompleteLifecycleAction -> QueryString
toQuery CompleteLifecycleAction' {Maybe Text
Text
lifecycleActionResult :: Text
autoScalingGroupName :: Text
lifecycleHookName :: Text
lifecycleActionToken :: Maybe Text
instanceId :: Maybe Text
$sel:lifecycleActionResult:CompleteLifecycleAction' :: CompleteLifecycleAction -> Text
$sel:autoScalingGroupName:CompleteLifecycleAction' :: CompleteLifecycleAction -> Text
$sel:lifecycleHookName:CompleteLifecycleAction' :: CompleteLifecycleAction -> Text
$sel:lifecycleActionToken:CompleteLifecycleAction' :: CompleteLifecycleAction -> Maybe Text
$sel:instanceId:CompleteLifecycleAction' :: CompleteLifecycleAction -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CompleteLifecycleAction" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
ByteString
"InstanceId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
instanceId,
ByteString
"LifecycleActionToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
lifecycleActionToken,
ByteString
"LifecycleHookName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
lifecycleHookName,
ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName,
ByteString
"LifecycleActionResult"
ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
lifecycleActionResult
]
data CompleteLifecycleActionResponse = CompleteLifecycleActionResponse'
{
CompleteLifecycleActionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CompleteLifecycleActionResponse
-> CompleteLifecycleActionResponse -> Bool
(CompleteLifecycleActionResponse
-> CompleteLifecycleActionResponse -> Bool)
-> (CompleteLifecycleActionResponse
-> CompleteLifecycleActionResponse -> Bool)
-> Eq CompleteLifecycleActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompleteLifecycleActionResponse
-> CompleteLifecycleActionResponse -> Bool
$c/= :: CompleteLifecycleActionResponse
-> CompleteLifecycleActionResponse -> Bool
== :: CompleteLifecycleActionResponse
-> CompleteLifecycleActionResponse -> Bool
$c== :: CompleteLifecycleActionResponse
-> CompleteLifecycleActionResponse -> Bool
Prelude.Eq, ReadPrec [CompleteLifecycleActionResponse]
ReadPrec CompleteLifecycleActionResponse
Int -> ReadS CompleteLifecycleActionResponse
ReadS [CompleteLifecycleActionResponse]
(Int -> ReadS CompleteLifecycleActionResponse)
-> ReadS [CompleteLifecycleActionResponse]
-> ReadPrec CompleteLifecycleActionResponse
-> ReadPrec [CompleteLifecycleActionResponse]
-> Read CompleteLifecycleActionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompleteLifecycleActionResponse]
$creadListPrec :: ReadPrec [CompleteLifecycleActionResponse]
readPrec :: ReadPrec CompleteLifecycleActionResponse
$creadPrec :: ReadPrec CompleteLifecycleActionResponse
readList :: ReadS [CompleteLifecycleActionResponse]
$creadList :: ReadS [CompleteLifecycleActionResponse]
readsPrec :: Int -> ReadS CompleteLifecycleActionResponse
$creadsPrec :: Int -> ReadS CompleteLifecycleActionResponse
Prelude.Read, Int -> CompleteLifecycleActionResponse -> ShowS
[CompleteLifecycleActionResponse] -> ShowS
CompleteLifecycleActionResponse -> String
(Int -> CompleteLifecycleActionResponse -> ShowS)
-> (CompleteLifecycleActionResponse -> String)
-> ([CompleteLifecycleActionResponse] -> ShowS)
-> Show CompleteLifecycleActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompleteLifecycleActionResponse] -> ShowS
$cshowList :: [CompleteLifecycleActionResponse] -> ShowS
show :: CompleteLifecycleActionResponse -> String
$cshow :: CompleteLifecycleActionResponse -> String
showsPrec :: Int -> CompleteLifecycleActionResponse -> ShowS
$cshowsPrec :: Int -> CompleteLifecycleActionResponse -> ShowS
Prelude.Show, (forall x.
CompleteLifecycleActionResponse
-> Rep CompleteLifecycleActionResponse x)
-> (forall x.
Rep CompleteLifecycleActionResponse x
-> CompleteLifecycleActionResponse)
-> Generic CompleteLifecycleActionResponse
forall x.
Rep CompleteLifecycleActionResponse x
-> CompleteLifecycleActionResponse
forall x.
CompleteLifecycleActionResponse
-> Rep CompleteLifecycleActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CompleteLifecycleActionResponse x
-> CompleteLifecycleActionResponse
$cfrom :: forall x.
CompleteLifecycleActionResponse
-> Rep CompleteLifecycleActionResponse x
Prelude.Generic)
newCompleteLifecycleActionResponse ::
Prelude.Int ->
CompleteLifecycleActionResponse
newCompleteLifecycleActionResponse :: Int -> CompleteLifecycleActionResponse
newCompleteLifecycleActionResponse Int
pHttpStatus_ =
CompleteLifecycleActionResponse' :: Int -> CompleteLifecycleActionResponse
CompleteLifecycleActionResponse'
{ $sel:httpStatus:CompleteLifecycleActionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
completeLifecycleActionResponse_httpStatus :: Lens.Lens' CompleteLifecycleActionResponse Prelude.Int
completeLifecycleActionResponse_httpStatus :: (Int -> f Int)
-> CompleteLifecycleActionResponse
-> f CompleteLifecycleActionResponse
completeLifecycleActionResponse_httpStatus = (CompleteLifecycleActionResponse -> Int)
-> (CompleteLifecycleActionResponse
-> Int -> CompleteLifecycleActionResponse)
-> Lens
CompleteLifecycleActionResponse
CompleteLifecycleActionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteLifecycleActionResponse' {Int
httpStatus :: Int
$sel:httpStatus:CompleteLifecycleActionResponse' :: CompleteLifecycleActionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CompleteLifecycleActionResponse
s@CompleteLifecycleActionResponse' {} Int
a -> CompleteLifecycleActionResponse
s {$sel:httpStatus:CompleteLifecycleActionResponse' :: Int
httpStatus = Int
a} :: CompleteLifecycleActionResponse)
instance
Prelude.NFData
CompleteLifecycleActionResponse