{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:protectionId:DisassociateHealthCheck' :: Text
protectionId =
Text
pProtectionId_,
$sel:healthCheckArn:DisassociateHealthCheck' :: Text
healthCheckArn = Text
pHealthCheckArn_
}
disassociateHealthCheck_protectionId :: Lens.Lens' DisassociateHealthCheck Prelude.Text
disassociateHealthCheck_protectionId :: Lens' DisassociateHealthCheck Text
disassociateHealthCheck_protectionId = 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 :: Lens' DisassociateHealthCheck Text
disassociateHealthCheck_healthCheckArn = 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 :: (Service -> Service)
-> DisassociateHealthCheck -> Request DisassociateHealthCheck
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisassociateHealthCheck
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateHealthCheck)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DisassociateHealthCheckResponse
DisassociateHealthCheckResponse'
forall (f :: * -> *) a b. Functor 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 DisassociateHealthCheck where
hashWithSalt :: Int -> DisassociateHealthCheck -> Int
hashWithSalt Int
_salt DisassociateHealthCheck' {Text
healthCheckArn :: Text
protectionId :: Text
$sel:healthCheckArn:DisassociateHealthCheck' :: DisassociateHealthCheck -> Text
$sel:protectionId:DisassociateHealthCheck' :: DisassociateHealthCheck -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
protectionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
healthCheckArn
instance Prelude.NFData DisassociateHealthCheck where
rnf :: DisassociateHealthCheck -> ()
rnf DisassociateHealthCheck' {Text
healthCheckArn :: Text
protectionId :: Text
$sel:healthCheckArn:DisassociateHealthCheck' :: DisassociateHealthCheck -> Text
$sel:protectionId:DisassociateHealthCheck' :: DisassociateHealthCheck -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
protectionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
healthCheckArn
instance Data.ToHeaders DisassociateHealthCheck where
toHeaders :: DisassociateHealthCheck -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSShield_20160616.DisassociateHealthCheck" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"ProtectionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
protectionId),
forall a. a -> Maybe a
Prelude.Just
(Key
"HealthCheckArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
healthCheckArn)
]
)
instance Data.ToPath DisassociateHealthCheck where
toPath :: DisassociateHealthCheck -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DisassociateHealthCheck where
toQuery :: DisassociateHealthCheck -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DisassociateHealthCheckResponse = DisassociateHealthCheckResponse'
{
DisassociateHealthCheckResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateHealthCheckResponse
-> DisassociateHealthCheckResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:DisassociateHealthCheckResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
disassociateHealthCheckResponse_httpStatus :: Lens.Lens' DisassociateHealthCheckResponse Prelude.Int
disassociateHealthCheckResponse_httpStatus :: Lens' DisassociateHealthCheckResponse Int
disassociateHealthCheckResponse_httpStatus = 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
where
rnf :: DisassociateHealthCheckResponse -> ()
rnf DisassociateHealthCheckResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateHealthCheckResponse' :: DisassociateHealthCheckResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus