{-# 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.Schemas.DeleteDiscoverer
-- 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 discoverer.
module Amazonka.Schemas.DeleteDiscoverer
  ( -- * Creating a Request
    DeleteDiscoverer (..),
    newDeleteDiscoverer,

    -- * Request Lenses
    deleteDiscoverer_discovererId,

    -- * Destructuring the Response
    DeleteDiscovererResponse (..),
    newDeleteDiscovererResponse,
  )
where

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

-- | /See:/ 'newDeleteDiscoverer' smart constructor.
data DeleteDiscoverer = DeleteDiscoverer'
  { -- | The ID of the discoverer.
    DeleteDiscoverer -> Text
discovererId :: Prelude.Text
  }
  deriving (DeleteDiscoverer -> DeleteDiscoverer -> Bool
(DeleteDiscoverer -> DeleteDiscoverer -> Bool)
-> (DeleteDiscoverer -> DeleteDiscoverer -> Bool)
-> Eq DeleteDiscoverer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDiscoverer -> DeleteDiscoverer -> Bool
$c/= :: DeleteDiscoverer -> DeleteDiscoverer -> Bool
== :: DeleteDiscoverer -> DeleteDiscoverer -> Bool
$c== :: DeleteDiscoverer -> DeleteDiscoverer -> Bool
Prelude.Eq, ReadPrec [DeleteDiscoverer]
ReadPrec DeleteDiscoverer
Int -> ReadS DeleteDiscoverer
ReadS [DeleteDiscoverer]
(Int -> ReadS DeleteDiscoverer)
-> ReadS [DeleteDiscoverer]
-> ReadPrec DeleteDiscoverer
-> ReadPrec [DeleteDiscoverer]
-> Read DeleteDiscoverer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDiscoverer]
$creadListPrec :: ReadPrec [DeleteDiscoverer]
readPrec :: ReadPrec DeleteDiscoverer
$creadPrec :: ReadPrec DeleteDiscoverer
readList :: ReadS [DeleteDiscoverer]
$creadList :: ReadS [DeleteDiscoverer]
readsPrec :: Int -> ReadS DeleteDiscoverer
$creadsPrec :: Int -> ReadS DeleteDiscoverer
Prelude.Read, Int -> DeleteDiscoverer -> ShowS
[DeleteDiscoverer] -> ShowS
DeleteDiscoverer -> String
(Int -> DeleteDiscoverer -> ShowS)
-> (DeleteDiscoverer -> String)
-> ([DeleteDiscoverer] -> ShowS)
-> Show DeleteDiscoverer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDiscoverer] -> ShowS
$cshowList :: [DeleteDiscoverer] -> ShowS
show :: DeleteDiscoverer -> String
$cshow :: DeleteDiscoverer -> String
showsPrec :: Int -> DeleteDiscoverer -> ShowS
$cshowsPrec :: Int -> DeleteDiscoverer -> ShowS
Prelude.Show, (forall x. DeleteDiscoverer -> Rep DeleteDiscoverer x)
-> (forall x. Rep DeleteDiscoverer x -> DeleteDiscoverer)
-> Generic DeleteDiscoverer
forall x. Rep DeleteDiscoverer x -> DeleteDiscoverer
forall x. DeleteDiscoverer -> Rep DeleteDiscoverer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDiscoverer x -> DeleteDiscoverer
$cfrom :: forall x. DeleteDiscoverer -> Rep DeleteDiscoverer x
Prelude.Generic)

-- |
-- Create a value of 'DeleteDiscoverer' 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:
--
-- 'discovererId', 'deleteDiscoverer_discovererId' - The ID of the discoverer.
newDeleteDiscoverer ::
  -- | 'discovererId'
  Prelude.Text ->
  DeleteDiscoverer
newDeleteDiscoverer :: Text -> DeleteDiscoverer
newDeleteDiscoverer Text
pDiscovererId_ =
  DeleteDiscoverer' :: Text -> DeleteDiscoverer
DeleteDiscoverer' {$sel:discovererId:DeleteDiscoverer' :: Text
discovererId = Text
pDiscovererId_}

-- | The ID of the discoverer.
deleteDiscoverer_discovererId :: Lens.Lens' DeleteDiscoverer Prelude.Text
deleteDiscoverer_discovererId :: (Text -> f Text) -> DeleteDiscoverer -> f DeleteDiscoverer
deleteDiscoverer_discovererId = (DeleteDiscoverer -> Text)
-> (DeleteDiscoverer -> Text -> DeleteDiscoverer)
-> Lens DeleteDiscoverer DeleteDiscoverer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDiscoverer' {Text
discovererId :: Text
$sel:discovererId:DeleteDiscoverer' :: DeleteDiscoverer -> Text
discovererId} -> Text
discovererId) (\s :: DeleteDiscoverer
s@DeleteDiscoverer' {} Text
a -> DeleteDiscoverer
s {$sel:discovererId:DeleteDiscoverer' :: Text
discovererId = Text
a} :: DeleteDiscoverer)

instance Core.AWSRequest DeleteDiscoverer where
  type
    AWSResponse DeleteDiscoverer =
      DeleteDiscovererResponse
  request :: DeleteDiscoverer -> Request DeleteDiscoverer
request = Service -> DeleteDiscoverer -> Request DeleteDiscoverer
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteDiscoverer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDiscoverer)))
response =
    AWSResponse DeleteDiscoverer
-> Logger
-> Service
-> Proxy DeleteDiscoverer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDiscoverer)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteDiscoverer
DeleteDiscovererResponse
DeleteDiscovererResponse'

instance Prelude.Hashable DeleteDiscoverer

instance Prelude.NFData DeleteDiscoverer

instance Core.ToHeaders DeleteDiscoverer where
  toHeaders :: DeleteDiscoverer -> [Header]
toHeaders =
    [Header] -> DeleteDiscoverer -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath DeleteDiscoverer where
  toPath :: DeleteDiscoverer -> ByteString
toPath DeleteDiscoverer' {Text
discovererId :: Text
$sel:discovererId:DeleteDiscoverer' :: DeleteDiscoverer -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/discoverers/id/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
discovererId]

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

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

-- |
-- Create a value of 'DeleteDiscovererResponse' 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.
newDeleteDiscovererResponse ::
  DeleteDiscovererResponse
newDeleteDiscovererResponse :: DeleteDiscovererResponse
newDeleteDiscovererResponse =
  DeleteDiscovererResponse
DeleteDiscovererResponse'

instance Prelude.NFData DeleteDiscovererResponse