{-# 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.ELBV2.RegisterTargets
(
RegisterTargets (..),
newRegisterTargets,
registerTargets_targetGroupArn,
registerTargets_targets,
RegisterTargetsResponse (..),
newRegisterTargetsResponse,
registerTargetsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ELBV2.Types
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 RegisterTargets = RegisterTargets'
{
RegisterTargets -> Text
targetGroupArn :: Prelude.Text,
RegisterTargets -> [TargetDescription]
targets :: [TargetDescription]
}
deriving (RegisterTargets -> RegisterTargets -> Bool
(RegisterTargets -> RegisterTargets -> Bool)
-> (RegisterTargets -> RegisterTargets -> Bool)
-> Eq RegisterTargets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterTargets -> RegisterTargets -> Bool
$c/= :: RegisterTargets -> RegisterTargets -> Bool
== :: RegisterTargets -> RegisterTargets -> Bool
$c== :: RegisterTargets -> RegisterTargets -> Bool
Prelude.Eq, ReadPrec [RegisterTargets]
ReadPrec RegisterTargets
Int -> ReadS RegisterTargets
ReadS [RegisterTargets]
(Int -> ReadS RegisterTargets)
-> ReadS [RegisterTargets]
-> ReadPrec RegisterTargets
-> ReadPrec [RegisterTargets]
-> Read RegisterTargets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterTargets]
$creadListPrec :: ReadPrec [RegisterTargets]
readPrec :: ReadPrec RegisterTargets
$creadPrec :: ReadPrec RegisterTargets
readList :: ReadS [RegisterTargets]
$creadList :: ReadS [RegisterTargets]
readsPrec :: Int -> ReadS RegisterTargets
$creadsPrec :: Int -> ReadS RegisterTargets
Prelude.Read, Int -> RegisterTargets -> ShowS
[RegisterTargets] -> ShowS
RegisterTargets -> String
(Int -> RegisterTargets -> ShowS)
-> (RegisterTargets -> String)
-> ([RegisterTargets] -> ShowS)
-> Show RegisterTargets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterTargets] -> ShowS
$cshowList :: [RegisterTargets] -> ShowS
show :: RegisterTargets -> String
$cshow :: RegisterTargets -> String
showsPrec :: Int -> RegisterTargets -> ShowS
$cshowsPrec :: Int -> RegisterTargets -> ShowS
Prelude.Show, (forall x. RegisterTargets -> Rep RegisterTargets x)
-> (forall x. Rep RegisterTargets x -> RegisterTargets)
-> Generic RegisterTargets
forall x. Rep RegisterTargets x -> RegisterTargets
forall x. RegisterTargets -> Rep RegisterTargets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterTargets x -> RegisterTargets
$cfrom :: forall x. RegisterTargets -> Rep RegisterTargets x
Prelude.Generic)
newRegisterTargets ::
Prelude.Text ->
RegisterTargets
newRegisterTargets :: Text -> RegisterTargets
newRegisterTargets Text
pTargetGroupArn_ =
RegisterTargets' :: Text -> [TargetDescription] -> RegisterTargets
RegisterTargets'
{ $sel:targetGroupArn:RegisterTargets' :: Text
targetGroupArn = Text
pTargetGroupArn_,
$sel:targets:RegisterTargets' :: [TargetDescription]
targets = [TargetDescription]
forall a. Monoid a => a
Prelude.mempty
}
registerTargets_targetGroupArn :: Lens.Lens' RegisterTargets Prelude.Text
registerTargets_targetGroupArn :: (Text -> f Text) -> RegisterTargets -> f RegisterTargets
registerTargets_targetGroupArn = (RegisterTargets -> Text)
-> (RegisterTargets -> Text -> RegisterTargets)
-> Lens RegisterTargets RegisterTargets Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTargets' {Text
targetGroupArn :: Text
$sel:targetGroupArn:RegisterTargets' :: RegisterTargets -> Text
targetGroupArn} -> Text
targetGroupArn) (\s :: RegisterTargets
s@RegisterTargets' {} Text
a -> RegisterTargets
s {$sel:targetGroupArn:RegisterTargets' :: Text
targetGroupArn = Text
a} :: RegisterTargets)
registerTargets_targets :: Lens.Lens' RegisterTargets [TargetDescription]
registerTargets_targets :: ([TargetDescription] -> f [TargetDescription])
-> RegisterTargets -> f RegisterTargets
registerTargets_targets = (RegisterTargets -> [TargetDescription])
-> (RegisterTargets -> [TargetDescription] -> RegisterTargets)
-> Lens
RegisterTargets
RegisterTargets
[TargetDescription]
[TargetDescription]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTargets' {[TargetDescription]
targets :: [TargetDescription]
$sel:targets:RegisterTargets' :: RegisterTargets -> [TargetDescription]
targets} -> [TargetDescription]
targets) (\s :: RegisterTargets
s@RegisterTargets' {} [TargetDescription]
a -> RegisterTargets
s {$sel:targets:RegisterTargets' :: [TargetDescription]
targets = [TargetDescription]
a} :: RegisterTargets) (([TargetDescription] -> f [TargetDescription])
-> RegisterTargets -> f RegisterTargets)
-> (([TargetDescription] -> f [TargetDescription])
-> [TargetDescription] -> f [TargetDescription])
-> ([TargetDescription] -> f [TargetDescription])
-> RegisterTargets
-> f RegisterTargets
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TargetDescription] -> f [TargetDescription])
-> [TargetDescription] -> f [TargetDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest RegisterTargets where
type
AWSResponse RegisterTargets =
RegisterTargetsResponse
request :: RegisterTargets -> Request RegisterTargets
request = Service -> RegisterTargets -> Request RegisterTargets
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy RegisterTargets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RegisterTargets)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse RegisterTargets))
-> Logger
-> Service
-> Proxy RegisterTargets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RegisterTargets)))
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
"RegisterTargetsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> RegisterTargetsResponse
RegisterTargetsResponse'
(Int -> RegisterTargetsResponse)
-> Either String Int -> Either String RegisterTargetsResponse
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 RegisterTargets
instance Prelude.NFData RegisterTargets
instance Core.ToHeaders RegisterTargets where
toHeaders :: RegisterTargets -> ResponseHeaders
toHeaders = ResponseHeaders -> RegisterTargets -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath RegisterTargets where
toPath :: RegisterTargets -> ByteString
toPath = ByteString -> RegisterTargets -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RegisterTargets where
toQuery :: RegisterTargets -> QueryString
toQuery RegisterTargets' {[TargetDescription]
Text
targets :: [TargetDescription]
targetGroupArn :: Text
$sel:targets:RegisterTargets' :: RegisterTargets -> [TargetDescription]
$sel:targetGroupArn:RegisterTargets' :: RegisterTargets -> 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
"RegisterTargets" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-12-01" :: Prelude.ByteString),
ByteString
"TargetGroupArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
targetGroupArn,
ByteString
"Targets" ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [TargetDescription] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [TargetDescription]
targets
]
data RegisterTargetsResponse = RegisterTargetsResponse'
{
RegisterTargetsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RegisterTargetsResponse -> RegisterTargetsResponse -> Bool
(RegisterTargetsResponse -> RegisterTargetsResponse -> Bool)
-> (RegisterTargetsResponse -> RegisterTargetsResponse -> Bool)
-> Eq RegisterTargetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterTargetsResponse -> RegisterTargetsResponse -> Bool
$c/= :: RegisterTargetsResponse -> RegisterTargetsResponse -> Bool
== :: RegisterTargetsResponse -> RegisterTargetsResponse -> Bool
$c== :: RegisterTargetsResponse -> RegisterTargetsResponse -> Bool
Prelude.Eq, ReadPrec [RegisterTargetsResponse]
ReadPrec RegisterTargetsResponse
Int -> ReadS RegisterTargetsResponse
ReadS [RegisterTargetsResponse]
(Int -> ReadS RegisterTargetsResponse)
-> ReadS [RegisterTargetsResponse]
-> ReadPrec RegisterTargetsResponse
-> ReadPrec [RegisterTargetsResponse]
-> Read RegisterTargetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterTargetsResponse]
$creadListPrec :: ReadPrec [RegisterTargetsResponse]
readPrec :: ReadPrec RegisterTargetsResponse
$creadPrec :: ReadPrec RegisterTargetsResponse
readList :: ReadS [RegisterTargetsResponse]
$creadList :: ReadS [RegisterTargetsResponse]
readsPrec :: Int -> ReadS RegisterTargetsResponse
$creadsPrec :: Int -> ReadS RegisterTargetsResponse
Prelude.Read, Int -> RegisterTargetsResponse -> ShowS
[RegisterTargetsResponse] -> ShowS
RegisterTargetsResponse -> String
(Int -> RegisterTargetsResponse -> ShowS)
-> (RegisterTargetsResponse -> String)
-> ([RegisterTargetsResponse] -> ShowS)
-> Show RegisterTargetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterTargetsResponse] -> ShowS
$cshowList :: [RegisterTargetsResponse] -> ShowS
show :: RegisterTargetsResponse -> String
$cshow :: RegisterTargetsResponse -> String
showsPrec :: Int -> RegisterTargetsResponse -> ShowS
$cshowsPrec :: Int -> RegisterTargetsResponse -> ShowS
Prelude.Show, (forall x.
RegisterTargetsResponse -> Rep RegisterTargetsResponse x)
-> (forall x.
Rep RegisterTargetsResponse x -> RegisterTargetsResponse)
-> Generic RegisterTargetsResponse
forall x. Rep RegisterTargetsResponse x -> RegisterTargetsResponse
forall x. RegisterTargetsResponse -> Rep RegisterTargetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterTargetsResponse x -> RegisterTargetsResponse
$cfrom :: forall x. RegisterTargetsResponse -> Rep RegisterTargetsResponse x
Prelude.Generic)
newRegisterTargetsResponse ::
Prelude.Int ->
RegisterTargetsResponse
newRegisterTargetsResponse :: Int -> RegisterTargetsResponse
newRegisterTargetsResponse Int
pHttpStatus_ =
RegisterTargetsResponse' :: Int -> RegisterTargetsResponse
RegisterTargetsResponse' {$sel:httpStatus:RegisterTargetsResponse' :: Int
httpStatus = Int
pHttpStatus_}
registerTargetsResponse_httpStatus :: Lens.Lens' RegisterTargetsResponse Prelude.Int
registerTargetsResponse_httpStatus :: (Int -> f Int)
-> RegisterTargetsResponse -> f RegisterTargetsResponse
registerTargetsResponse_httpStatus = (RegisterTargetsResponse -> Int)
-> (RegisterTargetsResponse -> Int -> RegisterTargetsResponse)
-> Lens RegisterTargetsResponse RegisterTargetsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTargetsResponse' {Int
httpStatus :: Int
$sel:httpStatus:RegisterTargetsResponse' :: RegisterTargetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RegisterTargetsResponse
s@RegisterTargetsResponse' {} Int
a -> RegisterTargetsResponse
s {$sel:httpStatus:RegisterTargetsResponse' :: Int
httpStatus = Int
a} :: RegisterTargetsResponse)
instance Prelude.NFData RegisterTargetsResponse