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