{-# 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.DeleteCustomDataIdentifier
-- 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)
--
-- Soft deletes a custom data identifier.
module Amazonka.MacieV2.DeleteCustomDataIdentifier
  ( -- * Creating a Request
    DeleteCustomDataIdentifier (..),
    newDeleteCustomDataIdentifier,

    -- * Request Lenses
    deleteCustomDataIdentifier_id,

    -- * Destructuring the Response
    DeleteCustomDataIdentifierResponse (..),
    newDeleteCustomDataIdentifierResponse,

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

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

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

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

instance Prelude.NFData DeleteCustomDataIdentifier

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

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

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

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

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

instance
  Prelude.NFData
    DeleteCustomDataIdentifierResponse