{-# 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.AttachLoadBalancers
(
AttachLoadBalancers (..),
newAttachLoadBalancers,
attachLoadBalancers_autoScalingGroupName,
attachLoadBalancers_loadBalancerNames,
AttachLoadBalancersResponse (..),
newAttachLoadBalancersResponse,
attachLoadBalancersResponse_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 AttachLoadBalancers = AttachLoadBalancers'
{
AttachLoadBalancers -> Text
autoScalingGroupName :: Prelude.Text,
AttachLoadBalancers -> [Text]
loadBalancerNames :: [Prelude.Text]
}
deriving (AttachLoadBalancers -> AttachLoadBalancers -> Bool
(AttachLoadBalancers -> AttachLoadBalancers -> Bool)
-> (AttachLoadBalancers -> AttachLoadBalancers -> Bool)
-> Eq AttachLoadBalancers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachLoadBalancers -> AttachLoadBalancers -> Bool
$c/= :: AttachLoadBalancers -> AttachLoadBalancers -> Bool
== :: AttachLoadBalancers -> AttachLoadBalancers -> Bool
$c== :: AttachLoadBalancers -> AttachLoadBalancers -> Bool
Prelude.Eq, ReadPrec [AttachLoadBalancers]
ReadPrec AttachLoadBalancers
Int -> ReadS AttachLoadBalancers
ReadS [AttachLoadBalancers]
(Int -> ReadS AttachLoadBalancers)
-> ReadS [AttachLoadBalancers]
-> ReadPrec AttachLoadBalancers
-> ReadPrec [AttachLoadBalancers]
-> Read AttachLoadBalancers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachLoadBalancers]
$creadListPrec :: ReadPrec [AttachLoadBalancers]
readPrec :: ReadPrec AttachLoadBalancers
$creadPrec :: ReadPrec AttachLoadBalancers
readList :: ReadS [AttachLoadBalancers]
$creadList :: ReadS [AttachLoadBalancers]
readsPrec :: Int -> ReadS AttachLoadBalancers
$creadsPrec :: Int -> ReadS AttachLoadBalancers
Prelude.Read, Int -> AttachLoadBalancers -> ShowS
[AttachLoadBalancers] -> ShowS
AttachLoadBalancers -> String
(Int -> AttachLoadBalancers -> ShowS)
-> (AttachLoadBalancers -> String)
-> ([AttachLoadBalancers] -> ShowS)
-> Show AttachLoadBalancers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachLoadBalancers] -> ShowS
$cshowList :: [AttachLoadBalancers] -> ShowS
show :: AttachLoadBalancers -> String
$cshow :: AttachLoadBalancers -> String
showsPrec :: Int -> AttachLoadBalancers -> ShowS
$cshowsPrec :: Int -> AttachLoadBalancers -> ShowS
Prelude.Show, (forall x. AttachLoadBalancers -> Rep AttachLoadBalancers x)
-> (forall x. Rep AttachLoadBalancers x -> AttachLoadBalancers)
-> Generic AttachLoadBalancers
forall x. Rep AttachLoadBalancers x -> AttachLoadBalancers
forall x. AttachLoadBalancers -> Rep AttachLoadBalancers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttachLoadBalancers x -> AttachLoadBalancers
$cfrom :: forall x. AttachLoadBalancers -> Rep AttachLoadBalancers x
Prelude.Generic)
newAttachLoadBalancers ::
Prelude.Text ->
AttachLoadBalancers
newAttachLoadBalancers :: Text -> AttachLoadBalancers
newAttachLoadBalancers Text
pAutoScalingGroupName_ =
AttachLoadBalancers' :: Text -> [Text] -> AttachLoadBalancers
AttachLoadBalancers'
{ $sel:autoScalingGroupName:AttachLoadBalancers' :: Text
autoScalingGroupName =
Text
pAutoScalingGroupName_,
$sel:loadBalancerNames:AttachLoadBalancers' :: [Text]
loadBalancerNames = [Text]
forall a. Monoid a => a
Prelude.mempty
}
attachLoadBalancers_autoScalingGroupName :: Lens.Lens' AttachLoadBalancers Prelude.Text
attachLoadBalancers_autoScalingGroupName :: (Text -> f Text) -> AttachLoadBalancers -> f AttachLoadBalancers
attachLoadBalancers_autoScalingGroupName = (AttachLoadBalancers -> Text)
-> (AttachLoadBalancers -> Text -> AttachLoadBalancers)
-> Lens AttachLoadBalancers AttachLoadBalancers Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachLoadBalancers' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:AttachLoadBalancers' :: AttachLoadBalancers -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: AttachLoadBalancers
s@AttachLoadBalancers' {} Text
a -> AttachLoadBalancers
s {$sel:autoScalingGroupName:AttachLoadBalancers' :: Text
autoScalingGroupName = Text
a} :: AttachLoadBalancers)
attachLoadBalancers_loadBalancerNames :: Lens.Lens' AttachLoadBalancers [Prelude.Text]
attachLoadBalancers_loadBalancerNames :: ([Text] -> f [Text])
-> AttachLoadBalancers -> f AttachLoadBalancers
attachLoadBalancers_loadBalancerNames = (AttachLoadBalancers -> [Text])
-> (AttachLoadBalancers -> [Text] -> AttachLoadBalancers)
-> Lens AttachLoadBalancers AttachLoadBalancers [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachLoadBalancers' {[Text]
loadBalancerNames :: [Text]
$sel:loadBalancerNames:AttachLoadBalancers' :: AttachLoadBalancers -> [Text]
loadBalancerNames} -> [Text]
loadBalancerNames) (\s :: AttachLoadBalancers
s@AttachLoadBalancers' {} [Text]
a -> AttachLoadBalancers
s {$sel:loadBalancerNames:AttachLoadBalancers' :: [Text]
loadBalancerNames = [Text]
a} :: AttachLoadBalancers) (([Text] -> f [Text])
-> AttachLoadBalancers -> f AttachLoadBalancers)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> AttachLoadBalancers
-> f AttachLoadBalancers
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 AttachLoadBalancers where
type
AWSResponse AttachLoadBalancers =
AttachLoadBalancersResponse
request :: AttachLoadBalancers -> Request AttachLoadBalancers
request = Service -> AttachLoadBalancers -> Request AttachLoadBalancers
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy AttachLoadBalancers
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AttachLoadBalancers)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse AttachLoadBalancers))
-> Logger
-> Service
-> Proxy AttachLoadBalancers
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AttachLoadBalancers)))
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
"AttachLoadBalancersResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> AttachLoadBalancersResponse
AttachLoadBalancersResponse'
(Int -> AttachLoadBalancersResponse)
-> Either String Int -> Either String AttachLoadBalancersResponse
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 AttachLoadBalancers
instance Prelude.NFData AttachLoadBalancers
instance Core.ToHeaders AttachLoadBalancers where
toHeaders :: AttachLoadBalancers -> ResponseHeaders
toHeaders = ResponseHeaders -> AttachLoadBalancers -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath AttachLoadBalancers where
toPath :: AttachLoadBalancers -> ByteString
toPath = ByteString -> AttachLoadBalancers -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AttachLoadBalancers where
toQuery :: AttachLoadBalancers -> QueryString
toQuery AttachLoadBalancers' {[Text]
Text
loadBalancerNames :: [Text]
autoScalingGroupName :: Text
$sel:loadBalancerNames:AttachLoadBalancers' :: AttachLoadBalancers -> [Text]
$sel:autoScalingGroupName:AttachLoadBalancers' :: AttachLoadBalancers -> 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
"AttachLoadBalancers" :: 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 AttachLoadBalancersResponse = AttachLoadBalancersResponse'
{
AttachLoadBalancersResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AttachLoadBalancersResponse -> AttachLoadBalancersResponse -> Bool
(AttachLoadBalancersResponse
-> AttachLoadBalancersResponse -> Bool)
-> (AttachLoadBalancersResponse
-> AttachLoadBalancersResponse -> Bool)
-> Eq AttachLoadBalancersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachLoadBalancersResponse -> AttachLoadBalancersResponse -> Bool
$c/= :: AttachLoadBalancersResponse -> AttachLoadBalancersResponse -> Bool
== :: AttachLoadBalancersResponse -> AttachLoadBalancersResponse -> Bool
$c== :: AttachLoadBalancersResponse -> AttachLoadBalancersResponse -> Bool
Prelude.Eq, ReadPrec [AttachLoadBalancersResponse]
ReadPrec AttachLoadBalancersResponse
Int -> ReadS AttachLoadBalancersResponse
ReadS [AttachLoadBalancersResponse]
(Int -> ReadS AttachLoadBalancersResponse)
-> ReadS [AttachLoadBalancersResponse]
-> ReadPrec AttachLoadBalancersResponse
-> ReadPrec [AttachLoadBalancersResponse]
-> Read AttachLoadBalancersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachLoadBalancersResponse]
$creadListPrec :: ReadPrec [AttachLoadBalancersResponse]
readPrec :: ReadPrec AttachLoadBalancersResponse
$creadPrec :: ReadPrec AttachLoadBalancersResponse
readList :: ReadS [AttachLoadBalancersResponse]
$creadList :: ReadS [AttachLoadBalancersResponse]
readsPrec :: Int -> ReadS AttachLoadBalancersResponse
$creadsPrec :: Int -> ReadS AttachLoadBalancersResponse
Prelude.Read, Int -> AttachLoadBalancersResponse -> ShowS
[AttachLoadBalancersResponse] -> ShowS
AttachLoadBalancersResponse -> String
(Int -> AttachLoadBalancersResponse -> ShowS)
-> (AttachLoadBalancersResponse -> String)
-> ([AttachLoadBalancersResponse] -> ShowS)
-> Show AttachLoadBalancersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachLoadBalancersResponse] -> ShowS
$cshowList :: [AttachLoadBalancersResponse] -> ShowS
show :: AttachLoadBalancersResponse -> String
$cshow :: AttachLoadBalancersResponse -> String
showsPrec :: Int -> AttachLoadBalancersResponse -> ShowS
$cshowsPrec :: Int -> AttachLoadBalancersResponse -> ShowS
Prelude.Show, (forall x.
AttachLoadBalancersResponse -> Rep AttachLoadBalancersResponse x)
-> (forall x.
Rep AttachLoadBalancersResponse x -> AttachLoadBalancersResponse)
-> Generic AttachLoadBalancersResponse
forall x.
Rep AttachLoadBalancersResponse x -> AttachLoadBalancersResponse
forall x.
AttachLoadBalancersResponse -> Rep AttachLoadBalancersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AttachLoadBalancersResponse x -> AttachLoadBalancersResponse
$cfrom :: forall x.
AttachLoadBalancersResponse -> Rep AttachLoadBalancersResponse x
Prelude.Generic)
newAttachLoadBalancersResponse ::
Prelude.Int ->
AttachLoadBalancersResponse
newAttachLoadBalancersResponse :: Int -> AttachLoadBalancersResponse
newAttachLoadBalancersResponse Int
pHttpStatus_ =
AttachLoadBalancersResponse' :: Int -> AttachLoadBalancersResponse
AttachLoadBalancersResponse'
{ $sel:httpStatus:AttachLoadBalancersResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
attachLoadBalancersResponse_httpStatus :: Lens.Lens' AttachLoadBalancersResponse Prelude.Int
attachLoadBalancersResponse_httpStatus :: (Int -> f Int)
-> AttachLoadBalancersResponse -> f AttachLoadBalancersResponse
attachLoadBalancersResponse_httpStatus = (AttachLoadBalancersResponse -> Int)
-> (AttachLoadBalancersResponse
-> Int -> AttachLoadBalancersResponse)
-> Lens
AttachLoadBalancersResponse AttachLoadBalancersResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachLoadBalancersResponse' {Int
httpStatus :: Int
$sel:httpStatus:AttachLoadBalancersResponse' :: AttachLoadBalancersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AttachLoadBalancersResponse
s@AttachLoadBalancersResponse' {} Int
a -> AttachLoadBalancersResponse
s {$sel:httpStatus:AttachLoadBalancersResponse' :: Int
httpStatus = Int
a} :: AttachLoadBalancersResponse)
instance Prelude.NFData AttachLoadBalancersResponse