{-# 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.DeleteVoiceConnectorOrigination
-- 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 origination settings for the specified Amazon Chime Voice
-- Connector.
--
-- If emergency calling is configured for the Amazon Chime Voice Connector,
-- it must be deleted prior to deleting the origination settings.
module Amazonka.Chime.DeleteVoiceConnectorOrigination
  ( -- * Creating a Request
    DeleteVoiceConnectorOrigination (..),
    newDeleteVoiceConnectorOrigination,

    -- * Request Lenses
    deleteVoiceConnectorOrigination_voiceConnectorId,

    -- * Destructuring the Response
    DeleteVoiceConnectorOriginationResponse (..),
    newDeleteVoiceConnectorOriginationResponse,
  )
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:/ 'newDeleteVoiceConnectorOrigination' smart constructor.
data DeleteVoiceConnectorOrigination = DeleteVoiceConnectorOrigination'
  { -- | The Amazon Chime Voice Connector ID.
    DeleteVoiceConnectorOrigination -> Text
voiceConnectorId :: Prelude.Text
  }
  deriving (DeleteVoiceConnectorOrigination
-> DeleteVoiceConnectorOrigination -> Bool
(DeleteVoiceConnectorOrigination
 -> DeleteVoiceConnectorOrigination -> Bool)
-> (DeleteVoiceConnectorOrigination
    -> DeleteVoiceConnectorOrigination -> Bool)
-> Eq DeleteVoiceConnectorOrigination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVoiceConnectorOrigination
-> DeleteVoiceConnectorOrigination -> Bool
$c/= :: DeleteVoiceConnectorOrigination
-> DeleteVoiceConnectorOrigination -> Bool
== :: DeleteVoiceConnectorOrigination
-> DeleteVoiceConnectorOrigination -> Bool
$c== :: DeleteVoiceConnectorOrigination
-> DeleteVoiceConnectorOrigination -> Bool
Prelude.Eq, ReadPrec [DeleteVoiceConnectorOrigination]
ReadPrec DeleteVoiceConnectorOrigination
Int -> ReadS DeleteVoiceConnectorOrigination
ReadS [DeleteVoiceConnectorOrigination]
(Int -> ReadS DeleteVoiceConnectorOrigination)
-> ReadS [DeleteVoiceConnectorOrigination]
-> ReadPrec DeleteVoiceConnectorOrigination
-> ReadPrec [DeleteVoiceConnectorOrigination]
-> Read DeleteVoiceConnectorOrigination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVoiceConnectorOrigination]
$creadListPrec :: ReadPrec [DeleteVoiceConnectorOrigination]
readPrec :: ReadPrec DeleteVoiceConnectorOrigination
$creadPrec :: ReadPrec DeleteVoiceConnectorOrigination
readList :: ReadS [DeleteVoiceConnectorOrigination]
$creadList :: ReadS [DeleteVoiceConnectorOrigination]
readsPrec :: Int -> ReadS DeleteVoiceConnectorOrigination
$creadsPrec :: Int -> ReadS DeleteVoiceConnectorOrigination
Prelude.Read, Int -> DeleteVoiceConnectorOrigination -> ShowS
[DeleteVoiceConnectorOrigination] -> ShowS
DeleteVoiceConnectorOrigination -> String
(Int -> DeleteVoiceConnectorOrigination -> ShowS)
-> (DeleteVoiceConnectorOrigination -> String)
-> ([DeleteVoiceConnectorOrigination] -> ShowS)
-> Show DeleteVoiceConnectorOrigination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVoiceConnectorOrigination] -> ShowS
$cshowList :: [DeleteVoiceConnectorOrigination] -> ShowS
show :: DeleteVoiceConnectorOrigination -> String
$cshow :: DeleteVoiceConnectorOrigination -> String
showsPrec :: Int -> DeleteVoiceConnectorOrigination -> ShowS
$cshowsPrec :: Int -> DeleteVoiceConnectorOrigination -> ShowS
Prelude.Show, (forall x.
 DeleteVoiceConnectorOrigination
 -> Rep DeleteVoiceConnectorOrigination x)
-> (forall x.
    Rep DeleteVoiceConnectorOrigination x
    -> DeleteVoiceConnectorOrigination)
-> Generic DeleteVoiceConnectorOrigination
forall x.
Rep DeleteVoiceConnectorOrigination x
-> DeleteVoiceConnectorOrigination
forall x.
DeleteVoiceConnectorOrigination
-> Rep DeleteVoiceConnectorOrigination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteVoiceConnectorOrigination x
-> DeleteVoiceConnectorOrigination
$cfrom :: forall x.
DeleteVoiceConnectorOrigination
-> Rep DeleteVoiceConnectorOrigination x
Prelude.Generic)

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

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

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

instance
  Prelude.Hashable
    DeleteVoiceConnectorOrigination

instance
  Prelude.NFData
    DeleteVoiceConnectorOrigination

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

instance Core.ToPath DeleteVoiceConnectorOrigination where
  toPath :: DeleteVoiceConnectorOrigination -> ByteString
toPath DeleteVoiceConnectorOrigination' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:DeleteVoiceConnectorOrigination' :: DeleteVoiceConnectorOrigination -> 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,
        ByteString
"/origination"
      ]

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

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

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

instance
  Prelude.NFData
    DeleteVoiceConnectorOriginationResponse