{-# 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.DetachLoadBalancers
(
DetachLoadBalancers (..),
newDetachLoadBalancers,
detachLoadBalancers_autoScalingGroupName,
detachLoadBalancers_loadBalancerNames,
DetachLoadBalancersResponse (..),
newDetachLoadBalancersResponse,
detachLoadBalancersResponse_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 DetachLoadBalancers = DetachLoadBalancers'
{
DetachLoadBalancers -> Text
autoScalingGroupName :: Prelude.Text,
DetachLoadBalancers -> [Text]
loadBalancerNames :: [Prelude.Text]
}
deriving (DetachLoadBalancers -> DetachLoadBalancers -> Bool
(DetachLoadBalancers -> DetachLoadBalancers -> Bool)
-> (DetachLoadBalancers -> DetachLoadBalancers -> Bool)
-> Eq DetachLoadBalancers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetachLoadBalancers -> DetachLoadBalancers -> Bool
$c/= :: DetachLoadBalancers -> DetachLoadBalancers -> Bool
== :: DetachLoadBalancers -> DetachLoadBalancers -> Bool
$c== :: DetachLoadBalancers -> DetachLoadBalancers -> Bool
Prelude.Eq, ReadPrec [DetachLoadBalancers]
ReadPrec DetachLoadBalancers
Int -> ReadS DetachLoadBalancers
ReadS [DetachLoadBalancers]
(Int -> ReadS DetachLoadBalancers)
-> ReadS [DetachLoadBalancers]
-> ReadPrec DetachLoadBalancers
-> ReadPrec [DetachLoadBalancers]
-> Read DetachLoadBalancers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetachLoadBalancers]
$creadListPrec :: ReadPrec [DetachLoadBalancers]
readPrec :: ReadPrec DetachLoadBalancers
$creadPrec :: ReadPrec DetachLoadBalancers
readList :: ReadS [DetachLoadBalancers]
$creadList :: ReadS [DetachLoadBalancers]
readsPrec :: Int -> ReadS DetachLoadBalancers
$creadsPrec :: Int -> ReadS DetachLoadBalancers
Prelude.Read, Int -> DetachLoadBalancers -> ShowS
[DetachLoadBalancers] -> ShowS
DetachLoadBalancers -> String
(Int -> DetachLoadBalancers -> ShowS)
-> (DetachLoadBalancers -> String)
-> ([DetachLoadBalancers] -> ShowS)
-> Show DetachLoadBalancers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetachLoadBalancers] -> ShowS
$cshowList :: [DetachLoadBalancers] -> ShowS
show :: DetachLoadBalancers -> String
$cshow :: DetachLoadBalancers -> String
showsPrec :: Int -> DetachLoadBalancers -> ShowS
$cshowsPrec :: Int -> DetachLoadBalancers -> ShowS
Prelude.Show, (forall x. DetachLoadBalancers -> Rep DetachLoadBalancers x)
-> (forall x. Rep DetachLoadBalancers x -> DetachLoadBalancers)
-> Generic DetachLoadBalancers
forall x. Rep DetachLoadBalancers x -> DetachLoadBalancers
forall x. DetachLoadBalancers -> Rep DetachLoadBalancers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetachLoadBalancers x -> DetachLoadBalancers
$cfrom :: forall x. DetachLoadBalancers -> Rep DetachLoadBalancers x
Prelude.Generic)
newDetachLoadBalancers ::
Prelude.Text ->
DetachLoadBalancers
newDetachLoadBalancers :: Text -> DetachLoadBalancers
newDetachLoadBalancers Text
pAutoScalingGroupName_ =
DetachLoadBalancers' :: Text -> [Text] -> DetachLoadBalancers
DetachLoadBalancers'
{ $sel:autoScalingGroupName:DetachLoadBalancers' :: Text
autoScalingGroupName =
Text
pAutoScalingGroupName_,
$sel:loadBalancerNames:DetachLoadBalancers' :: [Text]
loadBalancerNames = [Text]
forall a. Monoid a => a
Prelude.mempty
}
detachLoadBalancers_autoScalingGroupName :: Lens.Lens' DetachLoadBalancers Prelude.Text
detachLoadBalancers_autoScalingGroupName :: (Text -> f Text) -> DetachLoadBalancers -> f DetachLoadBalancers
detachLoadBalancers_autoScalingGroupName = (DetachLoadBalancers -> Text)
-> (DetachLoadBalancers -> Text -> DetachLoadBalancers)
-> Lens DetachLoadBalancers DetachLoadBalancers Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetachLoadBalancers' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:DetachLoadBalancers' :: DetachLoadBalancers -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: DetachLoadBalancers
s@DetachLoadBalancers' {} Text
a -> DetachLoadBalancers
s {$sel:autoScalingGroupName:DetachLoadBalancers' :: Text
autoScalingGroupName = Text
a} :: DetachLoadBalancers)
detachLoadBalancers_loadBalancerNames :: Lens.Lens' DetachLoadBalancers [Prelude.Text]
detachLoadBalancers_loadBalancerNames :: ([Text] -> f [Text])
-> DetachLoadBalancers -> f DetachLoadBalancers
detachLoadBalancers_loadBalancerNames = (DetachLoadBalancers -> [Text])
-> (DetachLoadBalancers -> [Text] -> DetachLoadBalancers)
-> Lens DetachLoadBalancers DetachLoadBalancers [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetachLoadBalancers' {[Text]
loadBalancerNames :: [Text]
$sel:loadBalancerNames:DetachLoadBalancers' :: DetachLoadBalancers -> [Text]
loadBalancerNames} -> [Text]
loadBalancerNames) (\s :: DetachLoadBalancers
s@DetachLoadBalancers' {} [Text]
a -> DetachLoadBalancers
s {$sel:loadBalancerNames:DetachLoadBalancers' :: [Text]
loadBalancerNames = [Text]
a} :: DetachLoadBalancers) (([Text] -> f [Text])
-> DetachLoadBalancers -> f DetachLoadBalancers)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DetachLoadBalancers
-> f DetachLoadBalancers
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DetachLoadBalancers where
type
AWSResponse DetachLoadBalancers =
DetachLoadBalancersResponse
request :: DetachLoadBalancers -> Request DetachLoadBalancers
request = Service -> DetachLoadBalancers -> Request DetachLoadBalancers
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DetachLoadBalancers
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DetachLoadBalancers)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DetachLoadBalancers))
-> Logger
-> Service
-> Proxy DetachLoadBalancers
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DetachLoadBalancers)))
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
"DetachLoadBalancersResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> DetachLoadBalancersResponse
DetachLoadBalancersResponse'
(Int -> DetachLoadBalancersResponse)
-> Either String Int -> Either String DetachLoadBalancersResponse
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 DetachLoadBalancers
instance Prelude.NFData DetachLoadBalancers
instance Core.ToHeaders DetachLoadBalancers where
toHeaders :: DetachLoadBalancers -> ResponseHeaders
toHeaders = ResponseHeaders -> DetachLoadBalancers -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DetachLoadBalancers where
toPath :: DetachLoadBalancers -> ByteString
toPath = ByteString -> DetachLoadBalancers -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DetachLoadBalancers where
toQuery :: DetachLoadBalancers -> QueryString
toQuery DetachLoadBalancers' {[Text]
Text
loadBalancerNames :: [Text]
autoScalingGroupName :: Text
$sel:loadBalancerNames:DetachLoadBalancers' :: DetachLoadBalancers -> [Text]
$sel:autoScalingGroupName:DetachLoadBalancers' :: DetachLoadBalancers -> 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
"DetachLoadBalancers" :: 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,
ByteString
"LoadBalancerNames"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [Text]
loadBalancerNames
]
data DetachLoadBalancersResponse = DetachLoadBalancersResponse'
{
DetachLoadBalancersResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DetachLoadBalancersResponse -> DetachLoadBalancersResponse -> Bool
(DetachLoadBalancersResponse
-> DetachLoadBalancersResponse -> Bool)
-> (DetachLoadBalancersResponse
-> DetachLoadBalancersResponse -> Bool)
-> Eq DetachLoadBalancersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetachLoadBalancersResponse -> DetachLoadBalancersResponse -> Bool
$c/= :: DetachLoadBalancersResponse -> DetachLoadBalancersResponse -> Bool
== :: DetachLoadBalancersResponse -> DetachLoadBalancersResponse -> Bool
$c== :: DetachLoadBalancersResponse -> DetachLoadBalancersResponse -> Bool
Prelude.Eq, ReadPrec [DetachLoadBalancersResponse]
ReadPrec DetachLoadBalancersResponse
Int -> ReadS DetachLoadBalancersResponse
ReadS [DetachLoadBalancersResponse]
(Int -> ReadS DetachLoadBalancersResponse)
-> ReadS [DetachLoadBalancersResponse]
-> ReadPrec DetachLoadBalancersResponse
-> ReadPrec [DetachLoadBalancersResponse]
-> Read DetachLoadBalancersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetachLoadBalancersResponse]
$creadListPrec :: ReadPrec [DetachLoadBalancersResponse]
readPrec :: ReadPrec DetachLoadBalancersResponse
$creadPrec :: ReadPrec DetachLoadBalancersResponse
readList :: ReadS [DetachLoadBalancersResponse]
$creadList :: ReadS [DetachLoadBalancersResponse]
readsPrec :: Int -> ReadS DetachLoadBalancersResponse
$creadsPrec :: Int -> ReadS DetachLoadBalancersResponse
Prelude.Read, Int -> DetachLoadBalancersResponse -> ShowS
[DetachLoadBalancersResponse] -> ShowS
DetachLoadBalancersResponse -> String
(Int -> DetachLoadBalancersResponse -> ShowS)
-> (DetachLoadBalancersResponse -> String)
-> ([DetachLoadBalancersResponse] -> ShowS)
-> Show DetachLoadBalancersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetachLoadBalancersResponse] -> ShowS
$cshowList :: [DetachLoadBalancersResponse] -> ShowS
show :: DetachLoadBalancersResponse -> String
$cshow :: DetachLoadBalancersResponse -> String
showsPrec :: Int -> DetachLoadBalancersResponse -> ShowS
$cshowsPrec :: Int -> DetachLoadBalancersResponse -> ShowS
Prelude.Show, (forall x.
DetachLoadBalancersResponse -> Rep DetachLoadBalancersResponse x)
-> (forall x.
Rep DetachLoadBalancersResponse x -> DetachLoadBalancersResponse)
-> Generic DetachLoadBalancersResponse
forall x.
Rep DetachLoadBalancersResponse x -> DetachLoadBalancersResponse
forall x.
DetachLoadBalancersResponse -> Rep DetachLoadBalancersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetachLoadBalancersResponse x -> DetachLoadBalancersResponse
$cfrom :: forall x.
DetachLoadBalancersResponse -> Rep DetachLoadBalancersResponse x
Prelude.Generic)
newDetachLoadBalancersResponse ::
Prelude.Int ->
DetachLoadBalancersResponse
newDetachLoadBalancersResponse :: Int -> DetachLoadBalancersResponse
newDetachLoadBalancersResponse Int
pHttpStatus_ =
DetachLoadBalancersResponse' :: Int -> DetachLoadBalancersResponse
DetachLoadBalancersResponse'
{ $sel:httpStatus:DetachLoadBalancersResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
detachLoadBalancersResponse_httpStatus :: Lens.Lens' DetachLoadBalancersResponse Prelude.Int
detachLoadBalancersResponse_httpStatus :: (Int -> f Int)
-> DetachLoadBalancersResponse -> f DetachLoadBalancersResponse
detachLoadBalancersResponse_httpStatus = (DetachLoadBalancersResponse -> Int)
-> (DetachLoadBalancersResponse
-> Int -> DetachLoadBalancersResponse)
-> Lens
DetachLoadBalancersResponse DetachLoadBalancersResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetachLoadBalancersResponse' {Int
httpStatus :: Int
$sel:httpStatus:DetachLoadBalancersResponse' :: DetachLoadBalancersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DetachLoadBalancersResponse
s@DetachLoadBalancersResponse' {} Int
a -> DetachLoadBalancersResponse
s {$sel:httpStatus:DetachLoadBalancersResponse' :: Int
httpStatus = Int
a} :: DetachLoadBalancersResponse)
instance Prelude.NFData DetachLoadBalancersResponse