{-# 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.CancelInstanceRefresh
(
CancelInstanceRefresh (..),
newCancelInstanceRefresh,
cancelInstanceRefresh_autoScalingGroupName,
CancelInstanceRefreshResponse (..),
newCancelInstanceRefreshResponse,
cancelInstanceRefreshResponse_instanceRefreshId,
cancelInstanceRefreshResponse_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 CancelInstanceRefresh = CancelInstanceRefresh'
{
CancelInstanceRefresh -> Text
autoScalingGroupName :: Prelude.Text
}
deriving (CancelInstanceRefresh -> CancelInstanceRefresh -> Bool
(CancelInstanceRefresh -> CancelInstanceRefresh -> Bool)
-> (CancelInstanceRefresh -> CancelInstanceRefresh -> Bool)
-> Eq CancelInstanceRefresh
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelInstanceRefresh -> CancelInstanceRefresh -> Bool
$c/= :: CancelInstanceRefresh -> CancelInstanceRefresh -> Bool
== :: CancelInstanceRefresh -> CancelInstanceRefresh -> Bool
$c== :: CancelInstanceRefresh -> CancelInstanceRefresh -> Bool
Prelude.Eq, ReadPrec [CancelInstanceRefresh]
ReadPrec CancelInstanceRefresh
Int -> ReadS CancelInstanceRefresh
ReadS [CancelInstanceRefresh]
(Int -> ReadS CancelInstanceRefresh)
-> ReadS [CancelInstanceRefresh]
-> ReadPrec CancelInstanceRefresh
-> ReadPrec [CancelInstanceRefresh]
-> Read CancelInstanceRefresh
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelInstanceRefresh]
$creadListPrec :: ReadPrec [CancelInstanceRefresh]
readPrec :: ReadPrec CancelInstanceRefresh
$creadPrec :: ReadPrec CancelInstanceRefresh
readList :: ReadS [CancelInstanceRefresh]
$creadList :: ReadS [CancelInstanceRefresh]
readsPrec :: Int -> ReadS CancelInstanceRefresh
$creadsPrec :: Int -> ReadS CancelInstanceRefresh
Prelude.Read, Int -> CancelInstanceRefresh -> ShowS
[CancelInstanceRefresh] -> ShowS
CancelInstanceRefresh -> String
(Int -> CancelInstanceRefresh -> ShowS)
-> (CancelInstanceRefresh -> String)
-> ([CancelInstanceRefresh] -> ShowS)
-> Show CancelInstanceRefresh
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelInstanceRefresh] -> ShowS
$cshowList :: [CancelInstanceRefresh] -> ShowS
show :: CancelInstanceRefresh -> String
$cshow :: CancelInstanceRefresh -> String
showsPrec :: Int -> CancelInstanceRefresh -> ShowS
$cshowsPrec :: Int -> CancelInstanceRefresh -> ShowS
Prelude.Show, (forall x. CancelInstanceRefresh -> Rep CancelInstanceRefresh x)
-> (forall x. Rep CancelInstanceRefresh x -> CancelInstanceRefresh)
-> Generic CancelInstanceRefresh
forall x. Rep CancelInstanceRefresh x -> CancelInstanceRefresh
forall x. CancelInstanceRefresh -> Rep CancelInstanceRefresh x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CancelInstanceRefresh x -> CancelInstanceRefresh
$cfrom :: forall x. CancelInstanceRefresh -> Rep CancelInstanceRefresh x
Prelude.Generic)
newCancelInstanceRefresh ::
Prelude.Text ->
CancelInstanceRefresh
newCancelInstanceRefresh :: Text -> CancelInstanceRefresh
newCancelInstanceRefresh Text
pAutoScalingGroupName_ =
CancelInstanceRefresh' :: Text -> CancelInstanceRefresh
CancelInstanceRefresh'
{ $sel:autoScalingGroupName:CancelInstanceRefresh' :: Text
autoScalingGroupName =
Text
pAutoScalingGroupName_
}
cancelInstanceRefresh_autoScalingGroupName :: Lens.Lens' CancelInstanceRefresh Prelude.Text
cancelInstanceRefresh_autoScalingGroupName :: (Text -> f Text)
-> CancelInstanceRefresh -> f CancelInstanceRefresh
cancelInstanceRefresh_autoScalingGroupName = (CancelInstanceRefresh -> Text)
-> (CancelInstanceRefresh -> Text -> CancelInstanceRefresh)
-> Lens CancelInstanceRefresh CancelInstanceRefresh Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelInstanceRefresh' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:CancelInstanceRefresh' :: CancelInstanceRefresh -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: CancelInstanceRefresh
s@CancelInstanceRefresh' {} Text
a -> CancelInstanceRefresh
s {$sel:autoScalingGroupName:CancelInstanceRefresh' :: Text
autoScalingGroupName = Text
a} :: CancelInstanceRefresh)
instance Core.AWSRequest CancelInstanceRefresh where
type
AWSResponse CancelInstanceRefresh =
CancelInstanceRefreshResponse
request :: CancelInstanceRefresh -> Request CancelInstanceRefresh
request = Service -> CancelInstanceRefresh -> Request CancelInstanceRefresh
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CancelInstanceRefresh
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelInstanceRefresh)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CancelInstanceRefresh))
-> Logger
-> Service
-> Proxy CancelInstanceRefresh
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelInstanceRefresh)))
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
"CancelInstanceRefreshResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Int -> CancelInstanceRefreshResponse
CancelInstanceRefreshResponse'
(Maybe Text -> Int -> CancelInstanceRefreshResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CancelInstanceRefreshResponse)
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
"InstanceRefreshId")
Either String (Int -> CancelInstanceRefreshResponse)
-> Either String Int -> Either String CancelInstanceRefreshResponse
forall (f :: * -> *) a b. Applicative f => 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 CancelInstanceRefresh
instance Prelude.NFData CancelInstanceRefresh
instance Core.ToHeaders CancelInstanceRefresh where
toHeaders :: CancelInstanceRefresh -> ResponseHeaders
toHeaders = ResponseHeaders -> CancelInstanceRefresh -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CancelInstanceRefresh where
toPath :: CancelInstanceRefresh -> ByteString
toPath = ByteString -> CancelInstanceRefresh -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CancelInstanceRefresh where
toQuery :: CancelInstanceRefresh -> QueryString
toQuery CancelInstanceRefresh' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:CancelInstanceRefresh' :: CancelInstanceRefresh -> 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
"CancelInstanceRefresh" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName
]
data CancelInstanceRefreshResponse = CancelInstanceRefreshResponse'
{
CancelInstanceRefreshResponse -> Maybe Text
instanceRefreshId :: Prelude.Maybe Prelude.Text,
CancelInstanceRefreshResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CancelInstanceRefreshResponse
-> CancelInstanceRefreshResponse -> Bool
(CancelInstanceRefreshResponse
-> CancelInstanceRefreshResponse -> Bool)
-> (CancelInstanceRefreshResponse
-> CancelInstanceRefreshResponse -> Bool)
-> Eq CancelInstanceRefreshResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelInstanceRefreshResponse
-> CancelInstanceRefreshResponse -> Bool
$c/= :: CancelInstanceRefreshResponse
-> CancelInstanceRefreshResponse -> Bool
== :: CancelInstanceRefreshResponse
-> CancelInstanceRefreshResponse -> Bool
$c== :: CancelInstanceRefreshResponse
-> CancelInstanceRefreshResponse -> Bool
Prelude.Eq, ReadPrec [CancelInstanceRefreshResponse]
ReadPrec CancelInstanceRefreshResponse
Int -> ReadS CancelInstanceRefreshResponse
ReadS [CancelInstanceRefreshResponse]
(Int -> ReadS CancelInstanceRefreshResponse)
-> ReadS [CancelInstanceRefreshResponse]
-> ReadPrec CancelInstanceRefreshResponse
-> ReadPrec [CancelInstanceRefreshResponse]
-> Read CancelInstanceRefreshResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelInstanceRefreshResponse]
$creadListPrec :: ReadPrec [CancelInstanceRefreshResponse]
readPrec :: ReadPrec CancelInstanceRefreshResponse
$creadPrec :: ReadPrec CancelInstanceRefreshResponse
readList :: ReadS [CancelInstanceRefreshResponse]
$creadList :: ReadS [CancelInstanceRefreshResponse]
readsPrec :: Int -> ReadS CancelInstanceRefreshResponse
$creadsPrec :: Int -> ReadS CancelInstanceRefreshResponse
Prelude.Read, Int -> CancelInstanceRefreshResponse -> ShowS
[CancelInstanceRefreshResponse] -> ShowS
CancelInstanceRefreshResponse -> String
(Int -> CancelInstanceRefreshResponse -> ShowS)
-> (CancelInstanceRefreshResponse -> String)
-> ([CancelInstanceRefreshResponse] -> ShowS)
-> Show CancelInstanceRefreshResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelInstanceRefreshResponse] -> ShowS
$cshowList :: [CancelInstanceRefreshResponse] -> ShowS
show :: CancelInstanceRefreshResponse -> String
$cshow :: CancelInstanceRefreshResponse -> String
showsPrec :: Int -> CancelInstanceRefreshResponse -> ShowS
$cshowsPrec :: Int -> CancelInstanceRefreshResponse -> ShowS
Prelude.Show, (forall x.
CancelInstanceRefreshResponse
-> Rep CancelInstanceRefreshResponse x)
-> (forall x.
Rep CancelInstanceRefreshResponse x
-> CancelInstanceRefreshResponse)
-> Generic CancelInstanceRefreshResponse
forall x.
Rep CancelInstanceRefreshResponse x
-> CancelInstanceRefreshResponse
forall x.
CancelInstanceRefreshResponse
-> Rep CancelInstanceRefreshResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelInstanceRefreshResponse x
-> CancelInstanceRefreshResponse
$cfrom :: forall x.
CancelInstanceRefreshResponse
-> Rep CancelInstanceRefreshResponse x
Prelude.Generic)
newCancelInstanceRefreshResponse ::
Prelude.Int ->
CancelInstanceRefreshResponse
newCancelInstanceRefreshResponse :: Int -> CancelInstanceRefreshResponse
newCancelInstanceRefreshResponse Int
pHttpStatus_ =
CancelInstanceRefreshResponse' :: Maybe Text -> Int -> CancelInstanceRefreshResponse
CancelInstanceRefreshResponse'
{ $sel:instanceRefreshId:CancelInstanceRefreshResponse' :: Maybe Text
instanceRefreshId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CancelInstanceRefreshResponse' :: Int
httpStatus = Int
pHttpStatus_
}
cancelInstanceRefreshResponse_instanceRefreshId :: Lens.Lens' CancelInstanceRefreshResponse (Prelude.Maybe Prelude.Text)
cancelInstanceRefreshResponse_instanceRefreshId :: (Maybe Text -> f (Maybe Text))
-> CancelInstanceRefreshResponse -> f CancelInstanceRefreshResponse
cancelInstanceRefreshResponse_instanceRefreshId = (CancelInstanceRefreshResponse -> Maybe Text)
-> (CancelInstanceRefreshResponse
-> Maybe Text -> CancelInstanceRefreshResponse)
-> Lens
CancelInstanceRefreshResponse
CancelInstanceRefreshResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelInstanceRefreshResponse' {Maybe Text
instanceRefreshId :: Maybe Text
$sel:instanceRefreshId:CancelInstanceRefreshResponse' :: CancelInstanceRefreshResponse -> Maybe Text
instanceRefreshId} -> Maybe Text
instanceRefreshId) (\s :: CancelInstanceRefreshResponse
s@CancelInstanceRefreshResponse' {} Maybe Text
a -> CancelInstanceRefreshResponse
s {$sel:instanceRefreshId:CancelInstanceRefreshResponse' :: Maybe Text
instanceRefreshId = Maybe Text
a} :: CancelInstanceRefreshResponse)
cancelInstanceRefreshResponse_httpStatus :: Lens.Lens' CancelInstanceRefreshResponse Prelude.Int
cancelInstanceRefreshResponse_httpStatus :: (Int -> f Int)
-> CancelInstanceRefreshResponse -> f CancelInstanceRefreshResponse
cancelInstanceRefreshResponse_httpStatus = (CancelInstanceRefreshResponse -> Int)
-> (CancelInstanceRefreshResponse
-> Int -> CancelInstanceRefreshResponse)
-> Lens
CancelInstanceRefreshResponse CancelInstanceRefreshResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelInstanceRefreshResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelInstanceRefreshResponse' :: CancelInstanceRefreshResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelInstanceRefreshResponse
s@CancelInstanceRefreshResponse' {} Int
a -> CancelInstanceRefreshResponse
s {$sel:httpStatus:CancelInstanceRefreshResponse' :: Int
httpStatus = Int
a} :: CancelInstanceRefreshResponse)
instance Prelude.NFData CancelInstanceRefreshResponse