{-# 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.VoiceId.DeleteSpeaker
-- 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 the specified speaker from the Amazon Connect Voice ID system.
module Amazonka.VoiceId.DeleteSpeaker
  ( -- * Creating a Request
    DeleteSpeaker (..),
    newDeleteSpeaker,

    -- * Request Lenses
    deleteSpeaker_domainId,
    deleteSpeaker_speakerId,

    -- * Destructuring the Response
    DeleteSpeakerResponse (..),
    newDeleteSpeakerResponse,
  )
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.VoiceId.Types

-- | /See:/ 'newDeleteSpeaker' smart constructor.
data DeleteSpeaker = DeleteSpeaker'
  { -- | The identifier of the domain containing the speaker.
    DeleteSpeaker -> Text
domainId :: Prelude.Text,
    -- | The identifier of the speaker you want to delete.
    DeleteSpeaker -> Sensitive Text
speakerId :: Core.Sensitive Prelude.Text
  }
  deriving (DeleteSpeaker -> DeleteSpeaker -> Bool
(DeleteSpeaker -> DeleteSpeaker -> Bool)
-> (DeleteSpeaker -> DeleteSpeaker -> Bool) -> Eq DeleteSpeaker
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSpeaker -> DeleteSpeaker -> Bool
$c/= :: DeleteSpeaker -> DeleteSpeaker -> Bool
== :: DeleteSpeaker -> DeleteSpeaker -> Bool
$c== :: DeleteSpeaker -> DeleteSpeaker -> Bool
Prelude.Eq, Int -> DeleteSpeaker -> ShowS
[DeleteSpeaker] -> ShowS
DeleteSpeaker -> String
(Int -> DeleteSpeaker -> ShowS)
-> (DeleteSpeaker -> String)
-> ([DeleteSpeaker] -> ShowS)
-> Show DeleteSpeaker
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSpeaker] -> ShowS
$cshowList :: [DeleteSpeaker] -> ShowS
show :: DeleteSpeaker -> String
$cshow :: DeleteSpeaker -> String
showsPrec :: Int -> DeleteSpeaker -> ShowS
$cshowsPrec :: Int -> DeleteSpeaker -> ShowS
Prelude.Show, (forall x. DeleteSpeaker -> Rep DeleteSpeaker x)
-> (forall x. Rep DeleteSpeaker x -> DeleteSpeaker)
-> Generic DeleteSpeaker
forall x. Rep DeleteSpeaker x -> DeleteSpeaker
forall x. DeleteSpeaker -> Rep DeleteSpeaker x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSpeaker x -> DeleteSpeaker
$cfrom :: forall x. DeleteSpeaker -> Rep DeleteSpeaker x
Prelude.Generic)

-- |
-- Create a value of 'DeleteSpeaker' 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:
--
-- 'domainId', 'deleteSpeaker_domainId' - The identifier of the domain containing the speaker.
--
-- 'speakerId', 'deleteSpeaker_speakerId' - The identifier of the speaker you want to delete.
newDeleteSpeaker ::
  -- | 'domainId'
  Prelude.Text ->
  -- | 'speakerId'
  Prelude.Text ->
  DeleteSpeaker
newDeleteSpeaker :: Text -> Text -> DeleteSpeaker
newDeleteSpeaker Text
pDomainId_ Text
pSpeakerId_ =
  DeleteSpeaker' :: Text -> Sensitive Text -> DeleteSpeaker
DeleteSpeaker'
    { $sel:domainId:DeleteSpeaker' :: Text
domainId = Text
pDomainId_,
      $sel:speakerId:DeleteSpeaker' :: Sensitive Text
speakerId = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pSpeakerId_
    }

-- | The identifier of the domain containing the speaker.
deleteSpeaker_domainId :: Lens.Lens' DeleteSpeaker Prelude.Text
deleteSpeaker_domainId :: (Text -> f Text) -> DeleteSpeaker -> f DeleteSpeaker
deleteSpeaker_domainId = (DeleteSpeaker -> Text)
-> (DeleteSpeaker -> Text -> DeleteSpeaker)
-> Lens DeleteSpeaker DeleteSpeaker Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSpeaker' {Text
domainId :: Text
$sel:domainId:DeleteSpeaker' :: DeleteSpeaker -> Text
domainId} -> Text
domainId) (\s :: DeleteSpeaker
s@DeleteSpeaker' {} Text
a -> DeleteSpeaker
s {$sel:domainId:DeleteSpeaker' :: Text
domainId = Text
a} :: DeleteSpeaker)

-- | The identifier of the speaker you want to delete.
deleteSpeaker_speakerId :: Lens.Lens' DeleteSpeaker Prelude.Text
deleteSpeaker_speakerId :: (Text -> f Text) -> DeleteSpeaker -> f DeleteSpeaker
deleteSpeaker_speakerId = (DeleteSpeaker -> Sensitive Text)
-> (DeleteSpeaker -> Sensitive Text -> DeleteSpeaker)
-> Lens
     DeleteSpeaker DeleteSpeaker (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSpeaker' {Sensitive Text
speakerId :: Sensitive Text
$sel:speakerId:DeleteSpeaker' :: DeleteSpeaker -> Sensitive Text
speakerId} -> Sensitive Text
speakerId) (\s :: DeleteSpeaker
s@DeleteSpeaker' {} Sensitive Text
a -> DeleteSpeaker
s {$sel:speakerId:DeleteSpeaker' :: Sensitive Text
speakerId = Sensitive Text
a} :: DeleteSpeaker) ((Sensitive Text -> f (Sensitive Text))
 -> DeleteSpeaker -> f DeleteSpeaker)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> DeleteSpeaker
-> f DeleteSpeaker
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

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

instance Prelude.Hashable DeleteSpeaker

instance Prelude.NFData DeleteSpeaker

instance Core.ToHeaders DeleteSpeaker where
  toHeaders :: DeleteSpeaker -> [Header]
toHeaders =
    [Header] -> DeleteSpeaker -> [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
"VoiceID.DeleteSpeaker" :: Prelude.ByteString),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DeleteSpeaker where
  toJSON :: DeleteSpeaker -> Value
toJSON DeleteSpeaker' {Text
Sensitive Text
speakerId :: Sensitive Text
domainId :: Text
$sel:speakerId:DeleteSpeaker' :: DeleteSpeaker -> Sensitive Text
$sel:domainId:DeleteSpeaker' :: DeleteSpeaker -> 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
"DomainId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SpeakerId" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
speakerId)
          ]
      )

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

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

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

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

instance Prelude.NFData DeleteSpeakerResponse