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