{-# 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.Shield.DisassociateHealthCheck
(
DisassociateHealthCheck (..),
newDisassociateHealthCheck,
disassociateHealthCheck_protectionId,
disassociateHealthCheck_healthCheckArn,
DisassociateHealthCheckResponse (..),
newDisassociateHealthCheckResponse,
disassociateHealthCheckResponse_httpStatus,
)
where
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
import Amazonka.Shield.Types
data DisassociateHealthCheck = DisassociateHealthCheck'
{
DisassociateHealthCheck -> Text
protectionId :: Prelude.Text,
DisassociateHealthCheck -> Text
healthCheckArn :: Prelude.Text
}
deriving (DisassociateHealthCheck -> DisassociateHealthCheck -> Bool
(DisassociateHealthCheck -> DisassociateHealthCheck -> Bool)
-> (DisassociateHealthCheck -> DisassociateHealthCheck -> Bool)
-> Eq DisassociateHealthCheck
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateHealthCheck -> DisassociateHealthCheck -> Bool
$c/= :: DisassociateHealthCheck -> DisassociateHealthCheck -> Bool
== :: DisassociateHealthCheck -> DisassociateHealthCheck -> Bool
$c== :: DisassociateHealthCheck -> DisassociateHealthCheck -> Bool
Prelude.Eq, ReadPrec [DisassociateHealthCheck]
ReadPrec DisassociateHealthCheck
Int -> ReadS DisassociateHealthCheck
ReadS [DisassociateHealthCheck]
(Int -> ReadS DisassociateHealthCheck)
-> ReadS [DisassociateHealthCheck]
-> ReadPrec DisassociateHealthCheck
-> ReadPrec [DisassociateHealthCheck]
-> Read DisassociateHealthCheck
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateHealthCheck]
$creadListPrec :: ReadPrec [DisassociateHealthCheck]
readPrec :: ReadPrec DisassociateHealthCheck
$creadPrec :: ReadPrec DisassociateHealthCheck
readList :: ReadS [DisassociateHealthCheck]
$creadList :: ReadS [DisassociateHealthCheck]
readsPrec :: Int -> ReadS DisassociateHealthCheck
$creadsPrec :: Int -> ReadS DisassociateHealthCheck
Prelude.Read, Int -> DisassociateHealthCheck -> ShowS
[DisassociateHealthCheck] -> ShowS
DisassociateHealthCheck -> String
(Int -> DisassociateHealthCheck -> ShowS)
-> (DisassociateHealthCheck -> String)
-> ([DisassociateHealthCheck] -> ShowS)
-> Show DisassociateHealthCheck
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateHealthCheck] -> ShowS
$cshowList :: [DisassociateHealthCheck] -> ShowS
show :: DisassociateHealthCheck -> String
$cshow :: DisassociateHealthCheck -> String
showsPrec :: Int -> DisassociateHealthCheck -> ShowS
$cshowsPrec :: Int -> DisassociateHealthCheck -> ShowS
Prelude.Show, (forall x.
DisassociateHealthCheck -> Rep DisassociateHealthCheck x)
-> (forall x.
Rep DisassociateHealthCheck x -> DisassociateHealthCheck)
-> Generic DisassociateHealthCheck
forall x. Rep DisassociateHealthCheck x -> DisassociateHealthCheck
forall x. DisassociateHealthCheck -> Rep DisassociateHealthCheck x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateHealthCheck x -> DisassociateHealthCheck
$cfrom :: forall x. DisassociateHealthCheck -> Rep DisassociateHealthCheck x
Prelude.Generic)
newDisassociateHealthCheck ::
Prelude.Text ->
Prelude.Text ->
DisassociateHealthCheck
newDisassociateHealthCheck :: Text -> Text -> DisassociateHealthCheck
newDisassociateHealthCheck
Text
pProtectionId_
Text
pHealthCheckArn_ =
DisassociateHealthCheck' :: Text -> Text -> DisassociateHealthCheck
DisassociateHealthCheck'
{ $sel:protectionId:DisassociateHealthCheck' :: Text
protectionId =
Text
pProtectionId_,
$sel:healthCheckArn:DisassociateHealthCheck' :: Text
healthCheckArn = Text
pHealthCheckArn_
}
disassociateHealthCheck_protectionId :: Lens.Lens' DisassociateHealthCheck Prelude.Text
disassociateHealthCheck_protectionId :: (Text -> f Text)
-> DisassociateHealthCheck -> f DisassociateHealthCheck
disassociateHealthCheck_protectionId = (DisassociateHealthCheck -> Text)
-> (DisassociateHealthCheck -> Text -> DisassociateHealthCheck)
-> Lens DisassociateHealthCheck DisassociateHealthCheck Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateHealthCheck' {Text
protectionId :: Text
$sel:protectionId:DisassociateHealthCheck' :: DisassociateHealthCheck -> Text
protectionId} -> Text
protectionId) (\s :: DisassociateHealthCheck
s@DisassociateHealthCheck' {} Text
a -> DisassociateHealthCheck
s {$sel:protectionId:DisassociateHealthCheck' :: Text
protectionId = Text
a} :: DisassociateHealthCheck)
disassociateHealthCheck_healthCheckArn :: Lens.Lens' DisassociateHealthCheck Prelude.Text
disassociateHealthCheck_healthCheckArn :: (Text -> f Text)
-> DisassociateHealthCheck -> f DisassociateHealthCheck
disassociateHealthCheck_healthCheckArn = (DisassociateHealthCheck -> Text)
-> (DisassociateHealthCheck -> Text -> DisassociateHealthCheck)
-> Lens DisassociateHealthCheck DisassociateHealthCheck Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateHealthCheck' {Text
healthCheckArn :: Text
$sel:healthCheckArn:DisassociateHealthCheck' :: DisassociateHealthCheck -> Text
healthCheckArn} -> Text
healthCheckArn) (\s :: DisassociateHealthCheck
s@DisassociateHealthCheck' {} Text
a -> DisassociateHealthCheck
s {$sel:healthCheckArn:DisassociateHealthCheck' :: Text
healthCheckArn = Text
a} :: DisassociateHealthCheck)
instance Core.AWSRequest DisassociateHealthCheck where
type
AWSResponse DisassociateHealthCheck =
DisassociateHealthCheckResponse
request :: DisassociateHealthCheck -> Request DisassociateHealthCheck
request = Service
-> DisassociateHealthCheck -> Request DisassociateHealthCheck
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateHealthCheck
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateHealthCheck)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DisassociateHealthCheck))
-> Logger
-> Service
-> Proxy DisassociateHealthCheck
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateHealthCheck)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DisassociateHealthCheckResponse
DisassociateHealthCheckResponse'
(Int -> DisassociateHealthCheckResponse)
-> Either String Int
-> Either String DisassociateHealthCheckResponse
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 DisassociateHealthCheck
instance Prelude.NFData DisassociateHealthCheck
instance Core.ToHeaders DisassociateHealthCheck where
toHeaders :: DisassociateHealthCheck -> ResponseHeaders
toHeaders =
ResponseHeaders -> DisassociateHealthCheck -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSShield_20160616.DisassociateHealthCheck" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DisassociateHealthCheck where
toJSON :: DisassociateHealthCheck -> Value
toJSON DisassociateHealthCheck' {Text
healthCheckArn :: Text
protectionId :: Text
$sel:healthCheckArn:DisassociateHealthCheck' :: DisassociateHealthCheck -> Text
$sel:protectionId:DisassociateHealthCheck' :: DisassociateHealthCheck -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ProtectionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
protectionId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"HealthCheckArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
healthCheckArn)
]
)
instance Core.ToPath DisassociateHealthCheck where
toPath :: DisassociateHealthCheck -> ByteString
toPath = ByteString -> DisassociateHealthCheck -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisassociateHealthCheck where
toQuery :: DisassociateHealthCheck -> QueryString
toQuery = QueryString -> DisassociateHealthCheck -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisassociateHealthCheckResponse = DisassociateHealthCheckResponse'
{
DisassociateHealthCheckResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateHealthCheckResponse
-> DisassociateHealthCheckResponse -> Bool
(DisassociateHealthCheckResponse
-> DisassociateHealthCheckResponse -> Bool)
-> (DisassociateHealthCheckResponse
-> DisassociateHealthCheckResponse -> Bool)
-> Eq DisassociateHealthCheckResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateHealthCheckResponse
-> DisassociateHealthCheckResponse -> Bool
$c/= :: DisassociateHealthCheckResponse
-> DisassociateHealthCheckResponse -> Bool
== :: DisassociateHealthCheckResponse
-> DisassociateHealthCheckResponse -> Bool
$c== :: DisassociateHealthCheckResponse
-> DisassociateHealthCheckResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateHealthCheckResponse]
ReadPrec DisassociateHealthCheckResponse
Int -> ReadS DisassociateHealthCheckResponse
ReadS [DisassociateHealthCheckResponse]
(Int -> ReadS DisassociateHealthCheckResponse)
-> ReadS [DisassociateHealthCheckResponse]
-> ReadPrec DisassociateHealthCheckResponse
-> ReadPrec [DisassociateHealthCheckResponse]
-> Read DisassociateHealthCheckResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateHealthCheckResponse]
$creadListPrec :: ReadPrec [DisassociateHealthCheckResponse]
readPrec :: ReadPrec DisassociateHealthCheckResponse
$creadPrec :: ReadPrec DisassociateHealthCheckResponse
readList :: ReadS [DisassociateHealthCheckResponse]
$creadList :: ReadS [DisassociateHealthCheckResponse]
readsPrec :: Int -> ReadS DisassociateHealthCheckResponse
$creadsPrec :: Int -> ReadS DisassociateHealthCheckResponse
Prelude.Read, Int -> DisassociateHealthCheckResponse -> ShowS
[DisassociateHealthCheckResponse] -> ShowS
DisassociateHealthCheckResponse -> String
(Int -> DisassociateHealthCheckResponse -> ShowS)
-> (DisassociateHealthCheckResponse -> String)
-> ([DisassociateHealthCheckResponse] -> ShowS)
-> Show DisassociateHealthCheckResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateHealthCheckResponse] -> ShowS
$cshowList :: [DisassociateHealthCheckResponse] -> ShowS
show :: DisassociateHealthCheckResponse -> String
$cshow :: DisassociateHealthCheckResponse -> String
showsPrec :: Int -> DisassociateHealthCheckResponse -> ShowS
$cshowsPrec :: Int -> DisassociateHealthCheckResponse -> ShowS
Prelude.Show, (forall x.
DisassociateHealthCheckResponse
-> Rep DisassociateHealthCheckResponse x)
-> (forall x.
Rep DisassociateHealthCheckResponse x
-> DisassociateHealthCheckResponse)
-> Generic DisassociateHealthCheckResponse
forall x.
Rep DisassociateHealthCheckResponse x
-> DisassociateHealthCheckResponse
forall x.
DisassociateHealthCheckResponse
-> Rep DisassociateHealthCheckResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateHealthCheckResponse x
-> DisassociateHealthCheckResponse
$cfrom :: forall x.
DisassociateHealthCheckResponse
-> Rep DisassociateHealthCheckResponse x
Prelude.Generic)
newDisassociateHealthCheckResponse ::
Prelude.Int ->
DisassociateHealthCheckResponse
newDisassociateHealthCheckResponse :: Int -> DisassociateHealthCheckResponse
newDisassociateHealthCheckResponse Int
pHttpStatus_ =
DisassociateHealthCheckResponse' :: Int -> DisassociateHealthCheckResponse
DisassociateHealthCheckResponse'
{ $sel:httpStatus:DisassociateHealthCheckResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
disassociateHealthCheckResponse_httpStatus :: Lens.Lens' DisassociateHealthCheckResponse Prelude.Int
disassociateHealthCheckResponse_httpStatus :: (Int -> f Int)
-> DisassociateHealthCheckResponse
-> f DisassociateHealthCheckResponse
disassociateHealthCheckResponse_httpStatus = (DisassociateHealthCheckResponse -> Int)
-> (DisassociateHealthCheckResponse
-> Int -> DisassociateHealthCheckResponse)
-> Lens
DisassociateHealthCheckResponse
DisassociateHealthCheckResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateHealthCheckResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateHealthCheckResponse' :: DisassociateHealthCheckResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateHealthCheckResponse
s@DisassociateHealthCheckResponse' {} Int
a -> DisassociateHealthCheckResponse
s {$sel:httpStatus:DisassociateHealthCheckResponse' :: Int
httpStatus = Int
a} :: DisassociateHealthCheckResponse)
instance
Prelude.NFData
DisassociateHealthCheckResponse