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