{-# 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.MacieV2.DeleteFindingsFilter
-- 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 a findings filter.
module Amazonka.MacieV2.DeleteFindingsFilter
  ( -- * Creating a Request
    DeleteFindingsFilter (..),
    newDeleteFindingsFilter,

    -- * Request Lenses
    deleteFindingsFilter_id,

    -- * Destructuring the Response
    DeleteFindingsFilterResponse (..),
    newDeleteFindingsFilterResponse,

    -- * Response Lenses
    deleteFindingsFilterResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeleteFindingsFilter' smart constructor.
data DeleteFindingsFilter = DeleteFindingsFilter'
  { -- | The unique identifier for the Amazon Macie resource or account that the
    -- request applies to.
    DeleteFindingsFilter -> Text
id :: Prelude.Text
  }
  deriving (DeleteFindingsFilter -> DeleteFindingsFilter -> Bool
(DeleteFindingsFilter -> DeleteFindingsFilter -> Bool)
-> (DeleteFindingsFilter -> DeleteFindingsFilter -> Bool)
-> Eq DeleteFindingsFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFindingsFilter -> DeleteFindingsFilter -> Bool
$c/= :: DeleteFindingsFilter -> DeleteFindingsFilter -> Bool
== :: DeleteFindingsFilter -> DeleteFindingsFilter -> Bool
$c== :: DeleteFindingsFilter -> DeleteFindingsFilter -> Bool
Prelude.Eq, ReadPrec [DeleteFindingsFilter]
ReadPrec DeleteFindingsFilter
Int -> ReadS DeleteFindingsFilter
ReadS [DeleteFindingsFilter]
(Int -> ReadS DeleteFindingsFilter)
-> ReadS [DeleteFindingsFilter]
-> ReadPrec DeleteFindingsFilter
-> ReadPrec [DeleteFindingsFilter]
-> Read DeleteFindingsFilter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFindingsFilter]
$creadListPrec :: ReadPrec [DeleteFindingsFilter]
readPrec :: ReadPrec DeleteFindingsFilter
$creadPrec :: ReadPrec DeleteFindingsFilter
readList :: ReadS [DeleteFindingsFilter]
$creadList :: ReadS [DeleteFindingsFilter]
readsPrec :: Int -> ReadS DeleteFindingsFilter
$creadsPrec :: Int -> ReadS DeleteFindingsFilter
Prelude.Read, Int -> DeleteFindingsFilter -> ShowS
[DeleteFindingsFilter] -> ShowS
DeleteFindingsFilter -> String
(Int -> DeleteFindingsFilter -> ShowS)
-> (DeleteFindingsFilter -> String)
-> ([DeleteFindingsFilter] -> ShowS)
-> Show DeleteFindingsFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFindingsFilter] -> ShowS
$cshowList :: [DeleteFindingsFilter] -> ShowS
show :: DeleteFindingsFilter -> String
$cshow :: DeleteFindingsFilter -> String
showsPrec :: Int -> DeleteFindingsFilter -> ShowS
$cshowsPrec :: Int -> DeleteFindingsFilter -> ShowS
Prelude.Show, (forall x. DeleteFindingsFilter -> Rep DeleteFindingsFilter x)
-> (forall x. Rep DeleteFindingsFilter x -> DeleteFindingsFilter)
-> Generic DeleteFindingsFilter
forall x. Rep DeleteFindingsFilter x -> DeleteFindingsFilter
forall x. DeleteFindingsFilter -> Rep DeleteFindingsFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFindingsFilter x -> DeleteFindingsFilter
$cfrom :: forall x. DeleteFindingsFilter -> Rep DeleteFindingsFilter x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFindingsFilter' 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:
--
-- 'id', 'deleteFindingsFilter_id' - The unique identifier for the Amazon Macie resource or account that the
-- request applies to.
newDeleteFindingsFilter ::
  -- | 'id'
  Prelude.Text ->
  DeleteFindingsFilter
newDeleteFindingsFilter :: Text -> DeleteFindingsFilter
newDeleteFindingsFilter Text
pId_ =
  DeleteFindingsFilter' :: Text -> DeleteFindingsFilter
DeleteFindingsFilter' {$sel:id:DeleteFindingsFilter' :: Text
id = Text
pId_}

-- | The unique identifier for the Amazon Macie resource or account that the
-- request applies to.
deleteFindingsFilter_id :: Lens.Lens' DeleteFindingsFilter Prelude.Text
deleteFindingsFilter_id :: (Text -> f Text) -> DeleteFindingsFilter -> f DeleteFindingsFilter
deleteFindingsFilter_id = (DeleteFindingsFilter -> Text)
-> (DeleteFindingsFilter -> Text -> DeleteFindingsFilter)
-> Lens DeleteFindingsFilter DeleteFindingsFilter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFindingsFilter' {Text
id :: Text
$sel:id:DeleteFindingsFilter' :: DeleteFindingsFilter -> Text
id} -> Text
id) (\s :: DeleteFindingsFilter
s@DeleteFindingsFilter' {} Text
a -> DeleteFindingsFilter
s {$sel:id:DeleteFindingsFilter' :: Text
id = Text
a} :: DeleteFindingsFilter)

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

instance Prelude.NFData DeleteFindingsFilter

instance Core.ToHeaders DeleteFindingsFilter where
  toHeaders :: DeleteFindingsFilter -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteFindingsFilter -> 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 DeleteFindingsFilter where
  toPath :: DeleteFindingsFilter -> ByteString
toPath DeleteFindingsFilter' {Text
id :: Text
$sel:id:DeleteFindingsFilter' :: DeleteFindingsFilter -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/findingsfilters/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]

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

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

-- |
-- Create a value of 'DeleteFindingsFilterResponse' 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', 'deleteFindingsFilterResponse_httpStatus' - The response's http status code.
newDeleteFindingsFilterResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteFindingsFilterResponse
newDeleteFindingsFilterResponse :: Int -> DeleteFindingsFilterResponse
newDeleteFindingsFilterResponse Int
pHttpStatus_ =
  DeleteFindingsFilterResponse' :: Int -> DeleteFindingsFilterResponse
DeleteFindingsFilterResponse'
    { $sel:httpStatus:DeleteFindingsFilterResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance Prelude.NFData DeleteFindingsFilterResponse