{-# 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.Transcribe.DeleteVocabulary
-- 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 vocabulary from Amazon Transcribe.
module Amazonka.Transcribe.DeleteVocabulary
  ( -- * Creating a Request
    DeleteVocabulary (..),
    newDeleteVocabulary,

    -- * Request Lenses
    deleteVocabulary_vocabularyName,

    -- * Destructuring the Response
    DeleteVocabularyResponse (..),
    newDeleteVocabularyResponse,
  )
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.Transcribe.Types

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

-- |
-- Create a value of 'DeleteVocabulary' 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:
--
-- 'vocabularyName', 'deleteVocabulary_vocabularyName' - The name of the vocabulary to delete.
newDeleteVocabulary ::
  -- | 'vocabularyName'
  Prelude.Text ->
  DeleteVocabulary
newDeleteVocabulary :: Text -> DeleteVocabulary
newDeleteVocabulary Text
pVocabularyName_ =
  DeleteVocabulary' :: Text -> DeleteVocabulary
DeleteVocabulary'
    { $sel:vocabularyName:DeleteVocabulary' :: Text
vocabularyName =
        Text
pVocabularyName_
    }

-- | The name of the vocabulary to delete.
deleteVocabulary_vocabularyName :: Lens.Lens' DeleteVocabulary Prelude.Text
deleteVocabulary_vocabularyName :: (Text -> f Text) -> DeleteVocabulary -> f DeleteVocabulary
deleteVocabulary_vocabularyName = (DeleteVocabulary -> Text)
-> (DeleteVocabulary -> Text -> DeleteVocabulary)
-> Lens DeleteVocabulary DeleteVocabulary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVocabulary' {Text
vocabularyName :: Text
$sel:vocabularyName:DeleteVocabulary' :: DeleteVocabulary -> Text
vocabularyName} -> Text
vocabularyName) (\s :: DeleteVocabulary
s@DeleteVocabulary' {} Text
a -> DeleteVocabulary
s {$sel:vocabularyName:DeleteVocabulary' :: Text
vocabularyName = Text
a} :: DeleteVocabulary)

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

instance Prelude.Hashable DeleteVocabulary

instance Prelude.NFData DeleteVocabulary

instance Core.ToHeaders DeleteVocabulary where
  toHeaders :: DeleteVocabulary -> [Header]
toHeaders =
    [Header] -> DeleteVocabulary -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"Transcribe.DeleteVocabulary" ::
                          Prelude.ByteString
                      ),
            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.ToJSON DeleteVocabulary where
  toJSON :: DeleteVocabulary -> Value
toJSON DeleteVocabulary' {Text
vocabularyName :: Text
$sel:vocabularyName:DeleteVocabulary' :: DeleteVocabulary -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"VocabularyName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
vocabularyName)
          ]
      )

instance Core.ToPath DeleteVocabulary where
  toPath :: DeleteVocabulary -> ByteString
toPath = ByteString -> DeleteVocabulary -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

instance Prelude.NFData DeleteVocabularyResponse