{-# 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.DeleteVoiceConnectorGroup
-- 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 group. Any
-- @VoiceConnectorItems@ and phone numbers associated with the group must
-- be removed before it can be deleted.
module Amazonka.Chime.DeleteVoiceConnectorGroup
  ( -- * Creating a Request
    DeleteVoiceConnectorGroup (..),
    newDeleteVoiceConnectorGroup,

    -- * Request Lenses
    deleteVoiceConnectorGroup_voiceConnectorGroupId,

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

-- |
-- Create a value of 'DeleteVoiceConnectorGroup' 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:
--
-- 'voiceConnectorGroupId', 'deleteVoiceConnectorGroup_voiceConnectorGroupId' - The Amazon Chime Voice Connector group ID.
newDeleteVoiceConnectorGroup ::
  -- | 'voiceConnectorGroupId'
  Prelude.Text ->
  DeleteVoiceConnectorGroup
newDeleteVoiceConnectorGroup :: Text -> DeleteVoiceConnectorGroup
newDeleteVoiceConnectorGroup Text
pVoiceConnectorGroupId_ =
  DeleteVoiceConnectorGroup' :: Text -> DeleteVoiceConnectorGroup
DeleteVoiceConnectorGroup'
    { $sel:voiceConnectorGroupId:DeleteVoiceConnectorGroup' :: Text
voiceConnectorGroupId =
        Text
pVoiceConnectorGroupId_
    }

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

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

instance Prelude.Hashable DeleteVoiceConnectorGroup

instance Prelude.NFData DeleteVoiceConnectorGroup

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

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

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

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

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

instance
  Prelude.NFData
    DeleteVoiceConnectorGroupResponse