{-# 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.DeleteLanguageModel
-- 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 custom language model using its name.
module Amazonka.Transcribe.DeleteLanguageModel
  ( -- * Creating a Request
    DeleteLanguageModel (..),
    newDeleteLanguageModel,

    -- * Request Lenses
    deleteLanguageModel_modelName,

    -- * Destructuring the Response
    DeleteLanguageModelResponse (..),
    newDeleteLanguageModelResponse,
  )
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:/ 'newDeleteLanguageModel' smart constructor.
data DeleteLanguageModel = DeleteLanguageModel'
  { -- | The name of the model you\'re choosing to delete.
    DeleteLanguageModel -> Text
modelName :: Prelude.Text
  }
  deriving (DeleteLanguageModel -> DeleteLanguageModel -> Bool
(DeleteLanguageModel -> DeleteLanguageModel -> Bool)
-> (DeleteLanguageModel -> DeleteLanguageModel -> Bool)
-> Eq DeleteLanguageModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLanguageModel -> DeleteLanguageModel -> Bool
$c/= :: DeleteLanguageModel -> DeleteLanguageModel -> Bool
== :: DeleteLanguageModel -> DeleteLanguageModel -> Bool
$c== :: DeleteLanguageModel -> DeleteLanguageModel -> Bool
Prelude.Eq, ReadPrec [DeleteLanguageModel]
ReadPrec DeleteLanguageModel
Int -> ReadS DeleteLanguageModel
ReadS [DeleteLanguageModel]
(Int -> ReadS DeleteLanguageModel)
-> ReadS [DeleteLanguageModel]
-> ReadPrec DeleteLanguageModel
-> ReadPrec [DeleteLanguageModel]
-> Read DeleteLanguageModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLanguageModel]
$creadListPrec :: ReadPrec [DeleteLanguageModel]
readPrec :: ReadPrec DeleteLanguageModel
$creadPrec :: ReadPrec DeleteLanguageModel
readList :: ReadS [DeleteLanguageModel]
$creadList :: ReadS [DeleteLanguageModel]
readsPrec :: Int -> ReadS DeleteLanguageModel
$creadsPrec :: Int -> ReadS DeleteLanguageModel
Prelude.Read, Int -> DeleteLanguageModel -> ShowS
[DeleteLanguageModel] -> ShowS
DeleteLanguageModel -> String
(Int -> DeleteLanguageModel -> ShowS)
-> (DeleteLanguageModel -> String)
-> ([DeleteLanguageModel] -> ShowS)
-> Show DeleteLanguageModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLanguageModel] -> ShowS
$cshowList :: [DeleteLanguageModel] -> ShowS
show :: DeleteLanguageModel -> String
$cshow :: DeleteLanguageModel -> String
showsPrec :: Int -> DeleteLanguageModel -> ShowS
$cshowsPrec :: Int -> DeleteLanguageModel -> ShowS
Prelude.Show, (forall x. DeleteLanguageModel -> Rep DeleteLanguageModel x)
-> (forall x. Rep DeleteLanguageModel x -> DeleteLanguageModel)
-> Generic DeleteLanguageModel
forall x. Rep DeleteLanguageModel x -> DeleteLanguageModel
forall x. DeleteLanguageModel -> Rep DeleteLanguageModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLanguageModel x -> DeleteLanguageModel
$cfrom :: forall x. DeleteLanguageModel -> Rep DeleteLanguageModel x
Prelude.Generic)

-- |
-- Create a value of 'DeleteLanguageModel' 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:
--
-- 'modelName', 'deleteLanguageModel_modelName' - The name of the model you\'re choosing to delete.
newDeleteLanguageModel ::
  -- | 'modelName'
  Prelude.Text ->
  DeleteLanguageModel
newDeleteLanguageModel :: Text -> DeleteLanguageModel
newDeleteLanguageModel Text
pModelName_ =
  DeleteLanguageModel' :: Text -> DeleteLanguageModel
DeleteLanguageModel' {$sel:modelName:DeleteLanguageModel' :: Text
modelName = Text
pModelName_}

-- | The name of the model you\'re choosing to delete.
deleteLanguageModel_modelName :: Lens.Lens' DeleteLanguageModel Prelude.Text
deleteLanguageModel_modelName :: (Text -> f Text) -> DeleteLanguageModel -> f DeleteLanguageModel
deleteLanguageModel_modelName = (DeleteLanguageModel -> Text)
-> (DeleteLanguageModel -> Text -> DeleteLanguageModel)
-> Lens DeleteLanguageModel DeleteLanguageModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLanguageModel' {Text
modelName :: Text
$sel:modelName:DeleteLanguageModel' :: DeleteLanguageModel -> Text
modelName} -> Text
modelName) (\s :: DeleteLanguageModel
s@DeleteLanguageModel' {} Text
a -> DeleteLanguageModel
s {$sel:modelName:DeleteLanguageModel' :: Text
modelName = Text
a} :: DeleteLanguageModel)

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

instance Prelude.Hashable DeleteLanguageModel

instance Prelude.NFData DeleteLanguageModel

instance Core.ToHeaders DeleteLanguageModel where
  toHeaders :: DeleteLanguageModel -> [Header]
toHeaders =
    [Header] -> DeleteLanguageModel -> [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.DeleteLanguageModel" ::
                          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 DeleteLanguageModel where
  toJSON :: DeleteLanguageModel -> Value
toJSON DeleteLanguageModel' {Text
modelName :: Text
$sel:modelName:DeleteLanguageModel' :: DeleteLanguageModel -> 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
"ModelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
modelName)]
      )

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

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

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

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

instance Prelude.NFData DeleteLanguageModelResponse