{-# 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.ELB.AttachLoadBalancerToSubnets
(
AttachLoadBalancerToSubnets (..),
newAttachLoadBalancerToSubnets,
attachLoadBalancerToSubnets_loadBalancerName,
attachLoadBalancerToSubnets_subnets,
AttachLoadBalancerToSubnetsResponse (..),
newAttachLoadBalancerToSubnetsResponse,
attachLoadBalancerToSubnetsResponse_subnets,
attachLoadBalancerToSubnetsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ELB.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AttachLoadBalancerToSubnets = AttachLoadBalancerToSubnets'
{
AttachLoadBalancerToSubnets -> Text
loadBalancerName :: Prelude.Text,
AttachLoadBalancerToSubnets -> [Text]
subnets :: [Prelude.Text]
}
deriving (AttachLoadBalancerToSubnets -> AttachLoadBalancerToSubnets -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachLoadBalancerToSubnets -> AttachLoadBalancerToSubnets -> Bool
$c/= :: AttachLoadBalancerToSubnets -> AttachLoadBalancerToSubnets -> Bool
== :: AttachLoadBalancerToSubnets -> AttachLoadBalancerToSubnets -> Bool
$c== :: AttachLoadBalancerToSubnets -> AttachLoadBalancerToSubnets -> Bool
Prelude.Eq, ReadPrec [AttachLoadBalancerToSubnets]
ReadPrec AttachLoadBalancerToSubnets
Int -> ReadS AttachLoadBalancerToSubnets
ReadS [AttachLoadBalancerToSubnets]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachLoadBalancerToSubnets]
$creadListPrec :: ReadPrec [AttachLoadBalancerToSubnets]
readPrec :: ReadPrec AttachLoadBalancerToSubnets
$creadPrec :: ReadPrec AttachLoadBalancerToSubnets
readList :: ReadS [AttachLoadBalancerToSubnets]
$creadList :: ReadS [AttachLoadBalancerToSubnets]
readsPrec :: Int -> ReadS AttachLoadBalancerToSubnets
$creadsPrec :: Int -> ReadS AttachLoadBalancerToSubnets
Prelude.Read, Int -> AttachLoadBalancerToSubnets -> ShowS
[AttachLoadBalancerToSubnets] -> ShowS
AttachLoadBalancerToSubnets -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachLoadBalancerToSubnets] -> ShowS
$cshowList :: [AttachLoadBalancerToSubnets] -> ShowS
show :: AttachLoadBalancerToSubnets -> String
$cshow :: AttachLoadBalancerToSubnets -> String
showsPrec :: Int -> AttachLoadBalancerToSubnets -> ShowS
$cshowsPrec :: Int -> AttachLoadBalancerToSubnets -> ShowS
Prelude.Show, forall x.
Rep AttachLoadBalancerToSubnets x -> AttachLoadBalancerToSubnets
forall x.
AttachLoadBalancerToSubnets -> Rep AttachLoadBalancerToSubnets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AttachLoadBalancerToSubnets x -> AttachLoadBalancerToSubnets
$cfrom :: forall x.
AttachLoadBalancerToSubnets -> Rep AttachLoadBalancerToSubnets x
Prelude.Generic)
newAttachLoadBalancerToSubnets ::
Prelude.Text ->
AttachLoadBalancerToSubnets
newAttachLoadBalancerToSubnets :: Text -> AttachLoadBalancerToSubnets
newAttachLoadBalancerToSubnets Text
pLoadBalancerName_ =
AttachLoadBalancerToSubnets'
{ $sel:loadBalancerName:AttachLoadBalancerToSubnets' :: Text
loadBalancerName =
Text
pLoadBalancerName_,
$sel:subnets:AttachLoadBalancerToSubnets' :: [Text]
subnets = forall a. Monoid a => a
Prelude.mempty
}
attachLoadBalancerToSubnets_loadBalancerName :: Lens.Lens' AttachLoadBalancerToSubnets Prelude.Text
attachLoadBalancerToSubnets_loadBalancerName :: Lens' AttachLoadBalancerToSubnets Text
attachLoadBalancerToSubnets_loadBalancerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachLoadBalancerToSubnets' {Text
loadBalancerName :: Text
$sel:loadBalancerName:AttachLoadBalancerToSubnets' :: AttachLoadBalancerToSubnets -> Text
loadBalancerName} -> Text
loadBalancerName) (\s :: AttachLoadBalancerToSubnets
s@AttachLoadBalancerToSubnets' {} Text
a -> AttachLoadBalancerToSubnets
s {$sel:loadBalancerName:AttachLoadBalancerToSubnets' :: Text
loadBalancerName = Text
a} :: AttachLoadBalancerToSubnets)
attachLoadBalancerToSubnets_subnets :: Lens.Lens' AttachLoadBalancerToSubnets [Prelude.Text]
attachLoadBalancerToSubnets_subnets :: Lens' AttachLoadBalancerToSubnets [Text]
attachLoadBalancerToSubnets_subnets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachLoadBalancerToSubnets' {[Text]
subnets :: [Text]
$sel:subnets:AttachLoadBalancerToSubnets' :: AttachLoadBalancerToSubnets -> [Text]
subnets} -> [Text]
subnets) (\s :: AttachLoadBalancerToSubnets
s@AttachLoadBalancerToSubnets' {} [Text]
a -> AttachLoadBalancerToSubnets
s {$sel:subnets:AttachLoadBalancerToSubnets' :: [Text]
subnets = [Text]
a} :: AttachLoadBalancerToSubnets) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest AttachLoadBalancerToSubnets where
type
AWSResponse AttachLoadBalancerToSubnets =
AttachLoadBalancerToSubnetsResponse
request :: (Service -> Service)
-> AttachLoadBalancerToSubnets
-> Request AttachLoadBalancerToSubnets
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy AttachLoadBalancerToSubnets
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AttachLoadBalancerToSubnets)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"AttachLoadBalancerToSubnetsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [Text] -> Int -> AttachLoadBalancerToSubnetsResponse
AttachLoadBalancerToSubnetsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Subnets"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable AttachLoadBalancerToSubnets where
hashWithSalt :: Int -> AttachLoadBalancerToSubnets -> Int
hashWithSalt Int
_salt AttachLoadBalancerToSubnets' {[Text]
Text
subnets :: [Text]
loadBalancerName :: Text
$sel:subnets:AttachLoadBalancerToSubnets' :: AttachLoadBalancerToSubnets -> [Text]
$sel:loadBalancerName:AttachLoadBalancerToSubnets' :: AttachLoadBalancerToSubnets -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
loadBalancerName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
subnets
instance Prelude.NFData AttachLoadBalancerToSubnets where
rnf :: AttachLoadBalancerToSubnets -> ()
rnf AttachLoadBalancerToSubnets' {[Text]
Text
subnets :: [Text]
loadBalancerName :: Text
$sel:subnets:AttachLoadBalancerToSubnets' :: AttachLoadBalancerToSubnets -> [Text]
$sel:loadBalancerName:AttachLoadBalancerToSubnets' :: AttachLoadBalancerToSubnets -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
loadBalancerName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
subnets
instance Data.ToHeaders AttachLoadBalancerToSubnets where
toHeaders :: AttachLoadBalancerToSubnets -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath AttachLoadBalancerToSubnets where
toPath :: AttachLoadBalancerToSubnets -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery AttachLoadBalancerToSubnets where
toQuery :: AttachLoadBalancerToSubnets -> QueryString
toQuery AttachLoadBalancerToSubnets' {[Text]
Text
subnets :: [Text]
loadBalancerName :: Text
$sel:subnets:AttachLoadBalancerToSubnets' :: AttachLoadBalancerToSubnets -> [Text]
$sel:loadBalancerName:AttachLoadBalancerToSubnets' :: AttachLoadBalancerToSubnets -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"AttachLoadBalancerToSubnets" ::
Prelude.ByteString
),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-06-01" :: Prelude.ByteString),
ByteString
"LoadBalancerName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
loadBalancerName,
ByteString
"Subnets" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" [Text]
subnets
]
data AttachLoadBalancerToSubnetsResponse = AttachLoadBalancerToSubnetsResponse'
{
AttachLoadBalancerToSubnetsResponse -> Maybe [Text]
subnets :: Prelude.Maybe [Prelude.Text],
AttachLoadBalancerToSubnetsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AttachLoadBalancerToSubnetsResponse
-> AttachLoadBalancerToSubnetsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachLoadBalancerToSubnetsResponse
-> AttachLoadBalancerToSubnetsResponse -> Bool
$c/= :: AttachLoadBalancerToSubnetsResponse
-> AttachLoadBalancerToSubnetsResponse -> Bool
== :: AttachLoadBalancerToSubnetsResponse
-> AttachLoadBalancerToSubnetsResponse -> Bool
$c== :: AttachLoadBalancerToSubnetsResponse
-> AttachLoadBalancerToSubnetsResponse -> Bool
Prelude.Eq, ReadPrec [AttachLoadBalancerToSubnetsResponse]
ReadPrec AttachLoadBalancerToSubnetsResponse
Int -> ReadS AttachLoadBalancerToSubnetsResponse
ReadS [AttachLoadBalancerToSubnetsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachLoadBalancerToSubnetsResponse]
$creadListPrec :: ReadPrec [AttachLoadBalancerToSubnetsResponse]
readPrec :: ReadPrec AttachLoadBalancerToSubnetsResponse
$creadPrec :: ReadPrec AttachLoadBalancerToSubnetsResponse
readList :: ReadS [AttachLoadBalancerToSubnetsResponse]
$creadList :: ReadS [AttachLoadBalancerToSubnetsResponse]
readsPrec :: Int -> ReadS AttachLoadBalancerToSubnetsResponse
$creadsPrec :: Int -> ReadS AttachLoadBalancerToSubnetsResponse
Prelude.Read, Int -> AttachLoadBalancerToSubnetsResponse -> ShowS
[AttachLoadBalancerToSubnetsResponse] -> ShowS
AttachLoadBalancerToSubnetsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachLoadBalancerToSubnetsResponse] -> ShowS
$cshowList :: [AttachLoadBalancerToSubnetsResponse] -> ShowS
show :: AttachLoadBalancerToSubnetsResponse -> String
$cshow :: AttachLoadBalancerToSubnetsResponse -> String
showsPrec :: Int -> AttachLoadBalancerToSubnetsResponse -> ShowS
$cshowsPrec :: Int -> AttachLoadBalancerToSubnetsResponse -> ShowS
Prelude.Show, forall x.
Rep AttachLoadBalancerToSubnetsResponse x
-> AttachLoadBalancerToSubnetsResponse
forall x.
AttachLoadBalancerToSubnetsResponse
-> Rep AttachLoadBalancerToSubnetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AttachLoadBalancerToSubnetsResponse x
-> AttachLoadBalancerToSubnetsResponse
$cfrom :: forall x.
AttachLoadBalancerToSubnetsResponse
-> Rep AttachLoadBalancerToSubnetsResponse x
Prelude.Generic)
newAttachLoadBalancerToSubnetsResponse ::
Prelude.Int ->
AttachLoadBalancerToSubnetsResponse
newAttachLoadBalancerToSubnetsResponse :: Int -> AttachLoadBalancerToSubnetsResponse
newAttachLoadBalancerToSubnetsResponse Int
pHttpStatus_ =
AttachLoadBalancerToSubnetsResponse'
{ $sel:subnets:AttachLoadBalancerToSubnetsResponse' :: Maybe [Text]
subnets =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AttachLoadBalancerToSubnetsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
attachLoadBalancerToSubnetsResponse_subnets :: Lens.Lens' AttachLoadBalancerToSubnetsResponse (Prelude.Maybe [Prelude.Text])
attachLoadBalancerToSubnetsResponse_subnets :: Lens' AttachLoadBalancerToSubnetsResponse (Maybe [Text])
attachLoadBalancerToSubnetsResponse_subnets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachLoadBalancerToSubnetsResponse' {Maybe [Text]
subnets :: Maybe [Text]
$sel:subnets:AttachLoadBalancerToSubnetsResponse' :: AttachLoadBalancerToSubnetsResponse -> Maybe [Text]
subnets} -> Maybe [Text]
subnets) (\s :: AttachLoadBalancerToSubnetsResponse
s@AttachLoadBalancerToSubnetsResponse' {} Maybe [Text]
a -> AttachLoadBalancerToSubnetsResponse
s {$sel:subnets:AttachLoadBalancerToSubnetsResponse' :: Maybe [Text]
subnets = Maybe [Text]
a} :: AttachLoadBalancerToSubnetsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
attachLoadBalancerToSubnetsResponse_httpStatus :: Lens.Lens' AttachLoadBalancerToSubnetsResponse Prelude.Int
attachLoadBalancerToSubnetsResponse_httpStatus :: Lens' AttachLoadBalancerToSubnetsResponse Int
attachLoadBalancerToSubnetsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachLoadBalancerToSubnetsResponse' {Int
httpStatus :: Int
$sel:httpStatus:AttachLoadBalancerToSubnetsResponse' :: AttachLoadBalancerToSubnetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AttachLoadBalancerToSubnetsResponse
s@AttachLoadBalancerToSubnetsResponse' {} Int
a -> AttachLoadBalancerToSubnetsResponse
s {$sel:httpStatus:AttachLoadBalancerToSubnetsResponse' :: Int
httpStatus = Int
a} :: AttachLoadBalancerToSubnetsResponse)
instance
Prelude.NFData
AttachLoadBalancerToSubnetsResponse
where
rnf :: AttachLoadBalancerToSubnetsResponse -> ()
rnf AttachLoadBalancerToSubnetsResponse' {Int
Maybe [Text]
httpStatus :: Int
subnets :: Maybe [Text]
$sel:httpStatus:AttachLoadBalancerToSubnetsResponse' :: AttachLoadBalancerToSubnetsResponse -> Int
$sel:subnets:AttachLoadBalancerToSubnetsResponse' :: AttachLoadBalancerToSubnetsResponse -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
subnets
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus