{-# 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.Chime.DeleteVoiceConnector
-- 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 Amazon Chime Voice Connector. Any phone numbers
-- associated with the Amazon Chime Voice Connector must be disassociated
-- from it before it can be deleted.
module Amazonka.Chime.DeleteVoiceConnector
  ( -- * Creating a Request
    DeleteVoiceConnector (..),
    newDeleteVoiceConnector,

    -- * Request Lenses
    deleteVoiceConnector_voiceConnectorId,

    -- * Destructuring the Response
    DeleteVoiceConnectorResponse (..),
    newDeleteVoiceConnectorResponse,
  )
where

import Amazonka.Chime.Types
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

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

-- |
-- Create a value of 'DeleteVoiceConnector' 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:
--
-- 'voiceConnectorId', 'deleteVoiceConnector_voiceConnectorId' - The Amazon Chime Voice Connector ID.
newDeleteVoiceConnector ::
  -- | 'voiceConnectorId'
  Prelude.Text ->
  DeleteVoiceConnector
newDeleteVoiceConnector :: Text -> DeleteVoiceConnector
newDeleteVoiceConnector Text
pVoiceConnectorId_ =
  DeleteVoiceConnector' :: Text -> DeleteVoiceConnector
DeleteVoiceConnector'
    { $sel:voiceConnectorId:DeleteVoiceConnector' :: Text
voiceConnectorId =
        Text
pVoiceConnectorId_
    }

-- | The Amazon Chime Voice Connector ID.
deleteVoiceConnector_voiceConnectorId :: Lens.Lens' DeleteVoiceConnector Prelude.Text
deleteVoiceConnector_voiceConnectorId :: (Text -> f Text) -> DeleteVoiceConnector -> f DeleteVoiceConnector
deleteVoiceConnector_voiceConnectorId = (DeleteVoiceConnector -> Text)
-> (DeleteVoiceConnector -> Text -> DeleteVoiceConnector)
-> Lens DeleteVoiceConnector DeleteVoiceConnector Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVoiceConnector' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:DeleteVoiceConnector' :: DeleteVoiceConnector -> Text
voiceConnectorId} -> Text
voiceConnectorId) (\s :: DeleteVoiceConnector
s@DeleteVoiceConnector' {} Text
a -> DeleteVoiceConnector
s {$sel:voiceConnectorId:DeleteVoiceConnector' :: Text
voiceConnectorId = Text
a} :: DeleteVoiceConnector)

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

instance Prelude.Hashable DeleteVoiceConnector

instance Prelude.NFData DeleteVoiceConnector

instance Core.ToHeaders DeleteVoiceConnector where
  toHeaders :: DeleteVoiceConnector -> [Header]
toHeaders = [Header] -> DeleteVoiceConnector -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DeleteVoiceConnector where
  toPath :: DeleteVoiceConnector -> ByteString
toPath DeleteVoiceConnector' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:DeleteVoiceConnector' :: DeleteVoiceConnector -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/voice-connectors/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
voiceConnectorId]

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

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

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

instance Prelude.NFData DeleteVoiceConnectorResponse