{-# 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.GuardDuty.DeleteIPSet
(
DeleteIPSet (..),
newDeleteIPSet,
deleteIPSet_detectorId,
deleteIPSet_ipSetId,
DeleteIPSetResponse (..),
newDeleteIPSetResponse,
deleteIPSetResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.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 DeleteIPSet = DeleteIPSet'
{
DeleteIPSet -> Text
detectorId :: Prelude.Text,
DeleteIPSet -> Text
ipSetId :: Prelude.Text
}
deriving (DeleteIPSet -> DeleteIPSet -> Bool
(DeleteIPSet -> DeleteIPSet -> Bool)
-> (DeleteIPSet -> DeleteIPSet -> Bool) -> Eq DeleteIPSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteIPSet -> DeleteIPSet -> Bool
$c/= :: DeleteIPSet -> DeleteIPSet -> Bool
== :: DeleteIPSet -> DeleteIPSet -> Bool
$c== :: DeleteIPSet -> DeleteIPSet -> Bool
Prelude.Eq, ReadPrec [DeleteIPSet]
ReadPrec DeleteIPSet
Int -> ReadS DeleteIPSet
ReadS [DeleteIPSet]
(Int -> ReadS DeleteIPSet)
-> ReadS [DeleteIPSet]
-> ReadPrec DeleteIPSet
-> ReadPrec [DeleteIPSet]
-> Read DeleteIPSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteIPSet]
$creadListPrec :: ReadPrec [DeleteIPSet]
readPrec :: ReadPrec DeleteIPSet
$creadPrec :: ReadPrec DeleteIPSet
readList :: ReadS [DeleteIPSet]
$creadList :: ReadS [DeleteIPSet]
readsPrec :: Int -> ReadS DeleteIPSet
$creadsPrec :: Int -> ReadS DeleteIPSet
Prelude.Read, Int -> DeleteIPSet -> ShowS
[DeleteIPSet] -> ShowS
DeleteIPSet -> String
(Int -> DeleteIPSet -> ShowS)
-> (DeleteIPSet -> String)
-> ([DeleteIPSet] -> ShowS)
-> Show DeleteIPSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteIPSet] -> ShowS
$cshowList :: [DeleteIPSet] -> ShowS
show :: DeleteIPSet -> String
$cshow :: DeleteIPSet -> String
showsPrec :: Int -> DeleteIPSet -> ShowS
$cshowsPrec :: Int -> DeleteIPSet -> ShowS
Prelude.Show, (forall x. DeleteIPSet -> Rep DeleteIPSet x)
-> (forall x. Rep DeleteIPSet x -> DeleteIPSet)
-> Generic DeleteIPSet
forall x. Rep DeleteIPSet x -> DeleteIPSet
forall x. DeleteIPSet -> Rep DeleteIPSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteIPSet x -> DeleteIPSet
$cfrom :: forall x. DeleteIPSet -> Rep DeleteIPSet x
Prelude.Generic)
newDeleteIPSet ::
Prelude.Text ->
Prelude.Text ->
DeleteIPSet
newDeleteIPSet :: Text -> Text -> DeleteIPSet
newDeleteIPSet Text
pDetectorId_ Text
pIpSetId_ =
DeleteIPSet' :: Text -> Text -> DeleteIPSet
DeleteIPSet'
{ $sel:detectorId:DeleteIPSet' :: Text
detectorId = Text
pDetectorId_,
$sel:ipSetId:DeleteIPSet' :: Text
ipSetId = Text
pIpSetId_
}
deleteIPSet_detectorId :: Lens.Lens' DeleteIPSet Prelude.Text
deleteIPSet_detectorId :: (Text -> f Text) -> DeleteIPSet -> f DeleteIPSet
deleteIPSet_detectorId = (DeleteIPSet -> Text)
-> (DeleteIPSet -> Text -> DeleteIPSet)
-> Lens DeleteIPSet DeleteIPSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIPSet' {Text
detectorId :: Text
$sel:detectorId:DeleteIPSet' :: DeleteIPSet -> Text
detectorId} -> Text
detectorId) (\s :: DeleteIPSet
s@DeleteIPSet' {} Text
a -> DeleteIPSet
s {$sel:detectorId:DeleteIPSet' :: Text
detectorId = Text
a} :: DeleteIPSet)
deleteIPSet_ipSetId :: Lens.Lens' DeleteIPSet Prelude.Text
deleteIPSet_ipSetId :: (Text -> f Text) -> DeleteIPSet -> f DeleteIPSet
deleteIPSet_ipSetId = (DeleteIPSet -> Text)
-> (DeleteIPSet -> Text -> DeleteIPSet)
-> Lens DeleteIPSet DeleteIPSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIPSet' {Text
ipSetId :: Text
$sel:ipSetId:DeleteIPSet' :: DeleteIPSet -> Text
ipSetId} -> Text
ipSetId) (\s :: DeleteIPSet
s@DeleteIPSet' {} Text
a -> DeleteIPSet
s {$sel:ipSetId:DeleteIPSet' :: Text
ipSetId = Text
a} :: DeleteIPSet)
instance Core.AWSRequest DeleteIPSet where
type AWSResponse DeleteIPSet = DeleteIPSetResponse
request :: DeleteIPSet -> Request DeleteIPSet
request = Service -> DeleteIPSet -> Request DeleteIPSet
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteIPSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteIPSet)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteIPSet))
-> Logger
-> Service
-> Proxy DeleteIPSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteIPSet)))
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 -> DeleteIPSetResponse
DeleteIPSetResponse'
(Int -> DeleteIPSetResponse)
-> Either String Int -> Either String DeleteIPSetResponse
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 DeleteIPSet
instance Prelude.NFData DeleteIPSet
instance Core.ToHeaders DeleteIPSet where
toHeaders :: DeleteIPSet -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteIPSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DeleteIPSet where
toPath :: DeleteIPSet -> ByteString
toPath DeleteIPSet' {Text
ipSetId :: Text
detectorId :: Text
$sel:ipSetId:DeleteIPSet' :: DeleteIPSet -> Text
$sel:detectorId:DeleteIPSet' :: DeleteIPSet -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/detector/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
detectorId,
ByteString
"/ipset/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
ipSetId
]
instance Core.ToQuery DeleteIPSet where
toQuery :: DeleteIPSet -> QueryString
toQuery = QueryString -> DeleteIPSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteIPSetResponse = DeleteIPSetResponse'
{
DeleteIPSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteIPSetResponse -> DeleteIPSetResponse -> Bool
(DeleteIPSetResponse -> DeleteIPSetResponse -> Bool)
-> (DeleteIPSetResponse -> DeleteIPSetResponse -> Bool)
-> Eq DeleteIPSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteIPSetResponse -> DeleteIPSetResponse -> Bool
$c/= :: DeleteIPSetResponse -> DeleteIPSetResponse -> Bool
== :: DeleteIPSetResponse -> DeleteIPSetResponse -> Bool
$c== :: DeleteIPSetResponse -> DeleteIPSetResponse -> Bool
Prelude.Eq, ReadPrec [DeleteIPSetResponse]
ReadPrec DeleteIPSetResponse
Int -> ReadS DeleteIPSetResponse
ReadS [DeleteIPSetResponse]
(Int -> ReadS DeleteIPSetResponse)
-> ReadS [DeleteIPSetResponse]
-> ReadPrec DeleteIPSetResponse
-> ReadPrec [DeleteIPSetResponse]
-> Read DeleteIPSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteIPSetResponse]
$creadListPrec :: ReadPrec [DeleteIPSetResponse]
readPrec :: ReadPrec DeleteIPSetResponse
$creadPrec :: ReadPrec DeleteIPSetResponse
readList :: ReadS [DeleteIPSetResponse]
$creadList :: ReadS [DeleteIPSetResponse]
readsPrec :: Int -> ReadS DeleteIPSetResponse
$creadsPrec :: Int -> ReadS DeleteIPSetResponse
Prelude.Read, Int -> DeleteIPSetResponse -> ShowS
[DeleteIPSetResponse] -> ShowS
DeleteIPSetResponse -> String
(Int -> DeleteIPSetResponse -> ShowS)
-> (DeleteIPSetResponse -> String)
-> ([DeleteIPSetResponse] -> ShowS)
-> Show DeleteIPSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteIPSetResponse] -> ShowS
$cshowList :: [DeleteIPSetResponse] -> ShowS
show :: DeleteIPSetResponse -> String
$cshow :: DeleteIPSetResponse -> String
showsPrec :: Int -> DeleteIPSetResponse -> ShowS
$cshowsPrec :: Int -> DeleteIPSetResponse -> ShowS
Prelude.Show, (forall x. DeleteIPSetResponse -> Rep DeleteIPSetResponse x)
-> (forall x. Rep DeleteIPSetResponse x -> DeleteIPSetResponse)
-> Generic DeleteIPSetResponse
forall x. Rep DeleteIPSetResponse x -> DeleteIPSetResponse
forall x. DeleteIPSetResponse -> Rep DeleteIPSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteIPSetResponse x -> DeleteIPSetResponse
$cfrom :: forall x. DeleteIPSetResponse -> Rep DeleteIPSetResponse x
Prelude.Generic)
newDeleteIPSetResponse ::
Prelude.Int ->
DeleteIPSetResponse
newDeleteIPSetResponse :: Int -> DeleteIPSetResponse
newDeleteIPSetResponse Int
pHttpStatus_ =
DeleteIPSetResponse' :: Int -> DeleteIPSetResponse
DeleteIPSetResponse' {$sel:httpStatus:DeleteIPSetResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteIPSetResponse_httpStatus :: Lens.Lens' DeleteIPSetResponse Prelude.Int
deleteIPSetResponse_httpStatus :: (Int -> f Int) -> DeleteIPSetResponse -> f DeleteIPSetResponse
deleteIPSetResponse_httpStatus = (DeleteIPSetResponse -> Int)
-> (DeleteIPSetResponse -> Int -> DeleteIPSetResponse)
-> Lens DeleteIPSetResponse DeleteIPSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIPSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteIPSetResponse' :: DeleteIPSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteIPSetResponse
s@DeleteIPSetResponse' {} Int
a -> DeleteIPSetResponse
s {$sel:httpStatus:DeleteIPSetResponse' :: Int
httpStatus = Int
a} :: DeleteIPSetResponse)
instance Prelude.NFData DeleteIPSetResponse