{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.GuardDuty.DeleteThreatIntelSet
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes the ThreatIntelSet specified by the ThreatIntelSet ID.
module Amazonka.GuardDuty.DeleteThreatIntelSet
  ( -- * Creating a Request
    DeleteThreatIntelSet (..),
    newDeleteThreatIntelSet,

    -- * Request Lenses
    deleteThreatIntelSet_detectorId,
    deleteThreatIntelSet_threatIntelSetId,

    -- * Destructuring the Response
    DeleteThreatIntelSetResponse (..),
    newDeleteThreatIntelSetResponse,

    -- * Response Lenses
    deleteThreatIntelSetResponse_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

-- | /See:/ 'newDeleteThreatIntelSet' smart constructor.
data DeleteThreatIntelSet = DeleteThreatIntelSet'
  { -- | The unique ID of the detector that the threatIntelSet is associated
    -- with.
    DeleteThreatIntelSet -> Text
detectorId :: Prelude.Text,
    -- | The unique ID of the threatIntelSet that you want to delete.
    DeleteThreatIntelSet -> Text
threatIntelSetId :: Prelude.Text
  }
  deriving (DeleteThreatIntelSet -> DeleteThreatIntelSet -> Bool
(DeleteThreatIntelSet -> DeleteThreatIntelSet -> Bool)
-> (DeleteThreatIntelSet -> DeleteThreatIntelSet -> Bool)
-> Eq DeleteThreatIntelSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteThreatIntelSet -> DeleteThreatIntelSet -> Bool
$c/= :: DeleteThreatIntelSet -> DeleteThreatIntelSet -> Bool
== :: DeleteThreatIntelSet -> DeleteThreatIntelSet -> Bool
$c== :: DeleteThreatIntelSet -> DeleteThreatIntelSet -> Bool
Prelude.Eq, ReadPrec [DeleteThreatIntelSet]
ReadPrec DeleteThreatIntelSet
Int -> ReadS DeleteThreatIntelSet
ReadS [DeleteThreatIntelSet]
(Int -> ReadS DeleteThreatIntelSet)
-> ReadS [DeleteThreatIntelSet]
-> ReadPrec DeleteThreatIntelSet
-> ReadPrec [DeleteThreatIntelSet]
-> Read DeleteThreatIntelSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteThreatIntelSet]
$creadListPrec :: ReadPrec [DeleteThreatIntelSet]
readPrec :: ReadPrec DeleteThreatIntelSet
$creadPrec :: ReadPrec DeleteThreatIntelSet
readList :: ReadS [DeleteThreatIntelSet]
$creadList :: ReadS [DeleteThreatIntelSet]
readsPrec :: Int -> ReadS DeleteThreatIntelSet
$creadsPrec :: Int -> ReadS DeleteThreatIntelSet
Prelude.Read, Int -> DeleteThreatIntelSet -> ShowS
[DeleteThreatIntelSet] -> ShowS
DeleteThreatIntelSet -> String
(Int -> DeleteThreatIntelSet -> ShowS)
-> (DeleteThreatIntelSet -> String)
-> ([DeleteThreatIntelSet] -> ShowS)
-> Show DeleteThreatIntelSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteThreatIntelSet] -> ShowS
$cshowList :: [DeleteThreatIntelSet] -> ShowS
show :: DeleteThreatIntelSet -> String
$cshow :: DeleteThreatIntelSet -> String
showsPrec :: Int -> DeleteThreatIntelSet -> ShowS
$cshowsPrec :: Int -> DeleteThreatIntelSet -> ShowS
Prelude.Show, (forall x. DeleteThreatIntelSet -> Rep DeleteThreatIntelSet x)
-> (forall x. Rep DeleteThreatIntelSet x -> DeleteThreatIntelSet)
-> Generic DeleteThreatIntelSet
forall x. Rep DeleteThreatIntelSet x -> DeleteThreatIntelSet
forall x. DeleteThreatIntelSet -> Rep DeleteThreatIntelSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteThreatIntelSet x -> DeleteThreatIntelSet
$cfrom :: forall x. DeleteThreatIntelSet -> Rep DeleteThreatIntelSet x
Prelude.Generic)

-- |
-- Create a value of 'DeleteThreatIntelSet' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'detectorId', 'deleteThreatIntelSet_detectorId' - The unique ID of the detector that the threatIntelSet is associated
-- with.
--
-- 'threatIntelSetId', 'deleteThreatIntelSet_threatIntelSetId' - The unique ID of the threatIntelSet that you want to delete.
newDeleteThreatIntelSet ::
  -- | 'detectorId'
  Prelude.Text ->
  -- | 'threatIntelSetId'
  Prelude.Text ->
  DeleteThreatIntelSet
newDeleteThreatIntelSet :: Text -> Text -> DeleteThreatIntelSet
newDeleteThreatIntelSet
  Text
pDetectorId_
  Text
pThreatIntelSetId_ =
    DeleteThreatIntelSet' :: Text -> Text -> DeleteThreatIntelSet
DeleteThreatIntelSet'
      { $sel:detectorId:DeleteThreatIntelSet' :: Text
detectorId = Text
pDetectorId_,
        $sel:threatIntelSetId:DeleteThreatIntelSet' :: Text
threatIntelSetId = Text
pThreatIntelSetId_
      }

-- | The unique ID of the detector that the threatIntelSet is associated
-- with.
deleteThreatIntelSet_detectorId :: Lens.Lens' DeleteThreatIntelSet Prelude.Text
deleteThreatIntelSet_detectorId :: (Text -> f Text) -> DeleteThreatIntelSet -> f DeleteThreatIntelSet
deleteThreatIntelSet_detectorId = (DeleteThreatIntelSet -> Text)
-> (DeleteThreatIntelSet -> Text -> DeleteThreatIntelSet)
-> Lens DeleteThreatIntelSet DeleteThreatIntelSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteThreatIntelSet' {Text
detectorId :: Text
$sel:detectorId:DeleteThreatIntelSet' :: DeleteThreatIntelSet -> Text
detectorId} -> Text
detectorId) (\s :: DeleteThreatIntelSet
s@DeleteThreatIntelSet' {} Text
a -> DeleteThreatIntelSet
s {$sel:detectorId:DeleteThreatIntelSet' :: Text
detectorId = Text
a} :: DeleteThreatIntelSet)

-- | The unique ID of the threatIntelSet that you want to delete.
deleteThreatIntelSet_threatIntelSetId :: Lens.Lens' DeleteThreatIntelSet Prelude.Text
deleteThreatIntelSet_threatIntelSetId :: (Text -> f Text) -> DeleteThreatIntelSet -> f DeleteThreatIntelSet
deleteThreatIntelSet_threatIntelSetId = (DeleteThreatIntelSet -> Text)
-> (DeleteThreatIntelSet -> Text -> DeleteThreatIntelSet)
-> Lens DeleteThreatIntelSet DeleteThreatIntelSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteThreatIntelSet' {Text
threatIntelSetId :: Text
$sel:threatIntelSetId:DeleteThreatIntelSet' :: DeleteThreatIntelSet -> Text
threatIntelSetId} -> Text
threatIntelSetId) (\s :: DeleteThreatIntelSet
s@DeleteThreatIntelSet' {} Text
a -> DeleteThreatIntelSet
s {$sel:threatIntelSetId:DeleteThreatIntelSet' :: Text
threatIntelSetId = Text
a} :: DeleteThreatIntelSet)

instance Core.AWSRequest DeleteThreatIntelSet where
  type
    AWSResponse DeleteThreatIntelSet =
      DeleteThreatIntelSetResponse
  request :: DeleteThreatIntelSet -> Request DeleteThreatIntelSet
request = Service -> DeleteThreatIntelSet -> Request DeleteThreatIntelSet
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteThreatIntelSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteThreatIntelSet)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteThreatIntelSet))
-> Logger
-> Service
-> Proxy DeleteThreatIntelSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteThreatIntelSet)))
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 -> DeleteThreatIntelSetResponse
DeleteThreatIntelSetResponse'
            (Int -> DeleteThreatIntelSetResponse)
-> Either String Int -> Either String DeleteThreatIntelSetResponse
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 DeleteThreatIntelSet

instance Prelude.NFData DeleteThreatIntelSet

instance Core.ToHeaders DeleteThreatIntelSet where
  toHeaders :: DeleteThreatIntelSet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteThreatIntelSet -> 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 DeleteThreatIntelSet where
  toPath :: DeleteThreatIntelSet -> ByteString
toPath DeleteThreatIntelSet' {Text
threatIntelSetId :: Text
detectorId :: Text
$sel:threatIntelSetId:DeleteThreatIntelSet' :: DeleteThreatIntelSet -> Text
$sel:detectorId:DeleteThreatIntelSet' :: DeleteThreatIntelSet -> 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
"/threatintelset/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
threatIntelSetId
      ]

instance Core.ToQuery DeleteThreatIntelSet where
  toQuery :: DeleteThreatIntelSet -> QueryString
toQuery = QueryString -> DeleteThreatIntelSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDeleteThreatIntelSetResponse' smart constructor.
data DeleteThreatIntelSetResponse = DeleteThreatIntelSetResponse'
  { -- | The response's http status code.
    DeleteThreatIntelSetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteThreatIntelSetResponse
-> DeleteThreatIntelSetResponse -> Bool
(DeleteThreatIntelSetResponse
 -> DeleteThreatIntelSetResponse -> Bool)
-> (DeleteThreatIntelSetResponse
    -> DeleteThreatIntelSetResponse -> Bool)
-> Eq DeleteThreatIntelSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteThreatIntelSetResponse
-> DeleteThreatIntelSetResponse -> Bool
$c/= :: DeleteThreatIntelSetResponse
-> DeleteThreatIntelSetResponse -> Bool
== :: DeleteThreatIntelSetResponse
-> DeleteThreatIntelSetResponse -> Bool
$c== :: DeleteThreatIntelSetResponse
-> DeleteThreatIntelSetResponse -> Bool
Prelude.Eq, ReadPrec [DeleteThreatIntelSetResponse]
ReadPrec DeleteThreatIntelSetResponse
Int -> ReadS DeleteThreatIntelSetResponse
ReadS [DeleteThreatIntelSetResponse]
(Int -> ReadS DeleteThreatIntelSetResponse)
-> ReadS [DeleteThreatIntelSetResponse]
-> ReadPrec DeleteThreatIntelSetResponse
-> ReadPrec [DeleteThreatIntelSetResponse]
-> Read DeleteThreatIntelSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteThreatIntelSetResponse]
$creadListPrec :: ReadPrec [DeleteThreatIntelSetResponse]
readPrec :: ReadPrec DeleteThreatIntelSetResponse
$creadPrec :: ReadPrec DeleteThreatIntelSetResponse
readList :: ReadS [DeleteThreatIntelSetResponse]
$creadList :: ReadS [DeleteThreatIntelSetResponse]
readsPrec :: Int -> ReadS DeleteThreatIntelSetResponse
$creadsPrec :: Int -> ReadS DeleteThreatIntelSetResponse
Prelude.Read, Int -> DeleteThreatIntelSetResponse -> ShowS
[DeleteThreatIntelSetResponse] -> ShowS
DeleteThreatIntelSetResponse -> String
(Int -> DeleteThreatIntelSetResponse -> ShowS)
-> (DeleteThreatIntelSetResponse -> String)
-> ([DeleteThreatIntelSetResponse] -> ShowS)
-> Show DeleteThreatIntelSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteThreatIntelSetResponse] -> ShowS
$cshowList :: [DeleteThreatIntelSetResponse] -> ShowS
show :: DeleteThreatIntelSetResponse -> String
$cshow :: DeleteThreatIntelSetResponse -> String
showsPrec :: Int -> DeleteThreatIntelSetResponse -> ShowS
$cshowsPrec :: Int -> DeleteThreatIntelSetResponse -> ShowS
Prelude.Show, (forall x.
 DeleteThreatIntelSetResponse -> Rep DeleteThreatIntelSetResponse x)
-> (forall x.
    Rep DeleteThreatIntelSetResponse x -> DeleteThreatIntelSetResponse)
-> Generic DeleteThreatIntelSetResponse
forall x.
Rep DeleteThreatIntelSetResponse x -> DeleteThreatIntelSetResponse
forall x.
DeleteThreatIntelSetResponse -> Rep DeleteThreatIntelSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteThreatIntelSetResponse x -> DeleteThreatIntelSetResponse
$cfrom :: forall x.
DeleteThreatIntelSetResponse -> Rep DeleteThreatIntelSetResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteThreatIntelSetResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'deleteThreatIntelSetResponse_httpStatus' - The response's http status code.
newDeleteThreatIntelSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteThreatIntelSetResponse
newDeleteThreatIntelSetResponse :: Int -> DeleteThreatIntelSetResponse
newDeleteThreatIntelSetResponse Int
pHttpStatus_ =
  DeleteThreatIntelSetResponse' :: Int -> DeleteThreatIntelSetResponse
DeleteThreatIntelSetResponse'
    { $sel:httpStatus:DeleteThreatIntelSetResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteThreatIntelSetResponse_httpStatus :: Lens.Lens' DeleteThreatIntelSetResponse Prelude.Int
deleteThreatIntelSetResponse_httpStatus :: (Int -> f Int)
-> DeleteThreatIntelSetResponse -> f DeleteThreatIntelSetResponse
deleteThreatIntelSetResponse_httpStatus = (DeleteThreatIntelSetResponse -> Int)
-> (DeleteThreatIntelSetResponse
    -> Int -> DeleteThreatIntelSetResponse)
-> Lens
     DeleteThreatIntelSetResponse DeleteThreatIntelSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteThreatIntelSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteThreatIntelSetResponse' :: DeleteThreatIntelSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteThreatIntelSetResponse
s@DeleteThreatIntelSetResponse' {} Int
a -> DeleteThreatIntelSetResponse
s {$sel:httpStatus:DeleteThreatIntelSetResponse' :: Int
httpStatus = Int
a} :: DeleteThreatIntelSetResponse)

instance Prelude.NFData DeleteThreatIntelSetResponse