{-# 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.Translate.DeleteTerminology
-- 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)
--
-- A synchronous action that deletes a custom terminology.
module Amazonka.Translate.DeleteTerminology
  ( -- * Creating a Request
    DeleteTerminology (..),
    newDeleteTerminology,

    -- * Request Lenses
    deleteTerminology_name,

    -- * Destructuring the Response
    DeleteTerminologyResponse (..),
    newDeleteTerminologyResponse,
  )
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.Translate.Types

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

-- |
-- Create a value of 'DeleteTerminology' 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:
--
-- 'name', 'deleteTerminology_name' - The name of the custom terminology being deleted.
newDeleteTerminology ::
  -- | 'name'
  Prelude.Text ->
  DeleteTerminology
newDeleteTerminology :: Text -> DeleteTerminology
newDeleteTerminology Text
pName_ =
  DeleteTerminology' :: Text -> DeleteTerminology
DeleteTerminology' {$sel:name:DeleteTerminology' :: Text
name = Text
pName_}

-- | The name of the custom terminology being deleted.
deleteTerminology_name :: Lens.Lens' DeleteTerminology Prelude.Text
deleteTerminology_name :: (Text -> f Text) -> DeleteTerminology -> f DeleteTerminology
deleteTerminology_name = (DeleteTerminology -> Text)
-> (DeleteTerminology -> Text -> DeleteTerminology)
-> Lens DeleteTerminology DeleteTerminology Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTerminology' {Text
name :: Text
$sel:name:DeleteTerminology' :: DeleteTerminology -> Text
name} -> Text
name) (\s :: DeleteTerminology
s@DeleteTerminology' {} Text
a -> DeleteTerminology
s {$sel:name:DeleteTerminology' :: Text
name = Text
a} :: DeleteTerminology)

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

instance Prelude.Hashable DeleteTerminology

instance Prelude.NFData DeleteTerminology

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

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

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

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

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

instance Prelude.NFData DeleteTerminologyResponse