{-# 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.DeleteVoiceConnectorTerminationCredentials
-- 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 SIP credentials used by your equipment to
-- authenticate during call termination.
module Amazonka.Chime.DeleteVoiceConnectorTerminationCredentials
  ( -- * Creating a Request
    DeleteVoiceConnectorTerminationCredentials (..),
    newDeleteVoiceConnectorTerminationCredentials,

    -- * Request Lenses
    deleteVoiceConnectorTerminationCredentials_usernames,
    deleteVoiceConnectorTerminationCredentials_voiceConnectorId,

    -- * Destructuring the Response
    DeleteVoiceConnectorTerminationCredentialsResponse (..),
    newDeleteVoiceConnectorTerminationCredentialsResponse,
  )
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:/ 'newDeleteVoiceConnectorTerminationCredentials' smart constructor.
data DeleteVoiceConnectorTerminationCredentials = DeleteVoiceConnectorTerminationCredentials'
  { -- | The RFC2617 compliant username associated with the SIP credentials, in
    -- US-ASCII format.
    DeleteVoiceConnectorTerminationCredentials -> [Sensitive Text]
usernames :: [Core.Sensitive Prelude.Text],
    -- | The Amazon Chime Voice Connector ID.
    DeleteVoiceConnectorTerminationCredentials -> Text
voiceConnectorId :: Prelude.Text
  }
  deriving (DeleteVoiceConnectorTerminationCredentials
-> DeleteVoiceConnectorTerminationCredentials -> Bool
(DeleteVoiceConnectorTerminationCredentials
 -> DeleteVoiceConnectorTerminationCredentials -> Bool)
-> (DeleteVoiceConnectorTerminationCredentials
    -> DeleteVoiceConnectorTerminationCredentials -> Bool)
-> Eq DeleteVoiceConnectorTerminationCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVoiceConnectorTerminationCredentials
-> DeleteVoiceConnectorTerminationCredentials -> Bool
$c/= :: DeleteVoiceConnectorTerminationCredentials
-> DeleteVoiceConnectorTerminationCredentials -> Bool
== :: DeleteVoiceConnectorTerminationCredentials
-> DeleteVoiceConnectorTerminationCredentials -> Bool
$c== :: DeleteVoiceConnectorTerminationCredentials
-> DeleteVoiceConnectorTerminationCredentials -> Bool
Prelude.Eq, Int -> DeleteVoiceConnectorTerminationCredentials -> ShowS
[DeleteVoiceConnectorTerminationCredentials] -> ShowS
DeleteVoiceConnectorTerminationCredentials -> String
(Int -> DeleteVoiceConnectorTerminationCredentials -> ShowS)
-> (DeleteVoiceConnectorTerminationCredentials -> String)
-> ([DeleteVoiceConnectorTerminationCredentials] -> ShowS)
-> Show DeleteVoiceConnectorTerminationCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVoiceConnectorTerminationCredentials] -> ShowS
$cshowList :: [DeleteVoiceConnectorTerminationCredentials] -> ShowS
show :: DeleteVoiceConnectorTerminationCredentials -> String
$cshow :: DeleteVoiceConnectorTerminationCredentials -> String
showsPrec :: Int -> DeleteVoiceConnectorTerminationCredentials -> ShowS
$cshowsPrec :: Int -> DeleteVoiceConnectorTerminationCredentials -> ShowS
Prelude.Show, (forall x.
 DeleteVoiceConnectorTerminationCredentials
 -> Rep DeleteVoiceConnectorTerminationCredentials x)
-> (forall x.
    Rep DeleteVoiceConnectorTerminationCredentials x
    -> DeleteVoiceConnectorTerminationCredentials)
-> Generic DeleteVoiceConnectorTerminationCredentials
forall x.
Rep DeleteVoiceConnectorTerminationCredentials x
-> DeleteVoiceConnectorTerminationCredentials
forall x.
DeleteVoiceConnectorTerminationCredentials
-> Rep DeleteVoiceConnectorTerminationCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteVoiceConnectorTerminationCredentials x
-> DeleteVoiceConnectorTerminationCredentials
$cfrom :: forall x.
DeleteVoiceConnectorTerminationCredentials
-> Rep DeleteVoiceConnectorTerminationCredentials x
Prelude.Generic)

-- |
-- Create a value of 'DeleteVoiceConnectorTerminationCredentials' 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:
--
-- 'usernames', 'deleteVoiceConnectorTerminationCredentials_usernames' - The RFC2617 compliant username associated with the SIP credentials, in
-- US-ASCII format.
--
-- 'voiceConnectorId', 'deleteVoiceConnectorTerminationCredentials_voiceConnectorId' - The Amazon Chime Voice Connector ID.
newDeleteVoiceConnectorTerminationCredentials ::
  -- | 'voiceConnectorId'
  Prelude.Text ->
  DeleteVoiceConnectorTerminationCredentials
newDeleteVoiceConnectorTerminationCredentials :: Text -> DeleteVoiceConnectorTerminationCredentials
newDeleteVoiceConnectorTerminationCredentials
  Text
pVoiceConnectorId_ =
    DeleteVoiceConnectorTerminationCredentials' :: [Sensitive Text]
-> Text -> DeleteVoiceConnectorTerminationCredentials
DeleteVoiceConnectorTerminationCredentials'
      { $sel:usernames:DeleteVoiceConnectorTerminationCredentials' :: [Sensitive Text]
usernames =
          [Sensitive Text]
forall a. Monoid a => a
Prelude.mempty,
        $sel:voiceConnectorId:DeleteVoiceConnectorTerminationCredentials' :: Text
voiceConnectorId =
          Text
pVoiceConnectorId_
      }

-- | The RFC2617 compliant username associated with the SIP credentials, in
-- US-ASCII format.
deleteVoiceConnectorTerminationCredentials_usernames :: Lens.Lens' DeleteVoiceConnectorTerminationCredentials [Prelude.Text]
deleteVoiceConnectorTerminationCredentials_usernames :: ([Text] -> f [Text])
-> DeleteVoiceConnectorTerminationCredentials
-> f DeleteVoiceConnectorTerminationCredentials
deleteVoiceConnectorTerminationCredentials_usernames = (DeleteVoiceConnectorTerminationCredentials -> [Sensitive Text])
-> (DeleteVoiceConnectorTerminationCredentials
    -> [Sensitive Text] -> DeleteVoiceConnectorTerminationCredentials)
-> Lens
     DeleteVoiceConnectorTerminationCredentials
     DeleteVoiceConnectorTerminationCredentials
     [Sensitive Text]
     [Sensitive Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVoiceConnectorTerminationCredentials' {[Sensitive Text]
usernames :: [Sensitive Text]
$sel:usernames:DeleteVoiceConnectorTerminationCredentials' :: DeleteVoiceConnectorTerminationCredentials -> [Sensitive Text]
usernames} -> [Sensitive Text]
usernames) (\s :: DeleteVoiceConnectorTerminationCredentials
s@DeleteVoiceConnectorTerminationCredentials' {} [Sensitive Text]
a -> DeleteVoiceConnectorTerminationCredentials
s {$sel:usernames:DeleteVoiceConnectorTerminationCredentials' :: [Sensitive Text]
usernames = [Sensitive Text]
a} :: DeleteVoiceConnectorTerminationCredentials) (([Sensitive Text] -> f [Sensitive Text])
 -> DeleteVoiceConnectorTerminationCredentials
 -> f DeleteVoiceConnectorTerminationCredentials)
-> (([Text] -> f [Text]) -> [Sensitive Text] -> f [Sensitive Text])
-> ([Text] -> f [Text])
-> DeleteVoiceConnectorTerminationCredentials
-> f DeleteVoiceConnectorTerminationCredentials
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Sensitive Text] -> f [Sensitive Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance
  Prelude.Hashable
    DeleteVoiceConnectorTerminationCredentials

instance
  Prelude.NFData
    DeleteVoiceConnectorTerminationCredentials

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

instance
  Core.ToJSON
    DeleteVoiceConnectorTerminationCredentials
  where
  toJSON :: DeleteVoiceConnectorTerminationCredentials -> Value
toJSON
    DeleteVoiceConnectorTerminationCredentials' {[Sensitive Text]
Text
voiceConnectorId :: Text
usernames :: [Sensitive Text]
$sel:voiceConnectorId:DeleteVoiceConnectorTerminationCredentials' :: DeleteVoiceConnectorTerminationCredentials -> Text
$sel:usernames:DeleteVoiceConnectorTerminationCredentials' :: DeleteVoiceConnectorTerminationCredentials -> [Sensitive 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
"Usernames" Text -> [Sensitive Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Sensitive Text]
usernames)]
        )

instance
  Core.ToPath
    DeleteVoiceConnectorTerminationCredentials
  where
  toPath :: DeleteVoiceConnectorTerminationCredentials -> ByteString
toPath
    DeleteVoiceConnectorTerminationCredentials' {[Sensitive Text]
Text
voiceConnectorId :: Text
usernames :: [Sensitive Text]
$sel:voiceConnectorId:DeleteVoiceConnectorTerminationCredentials' :: DeleteVoiceConnectorTerminationCredentials -> Text
$sel:usernames:DeleteVoiceConnectorTerminationCredentials' :: DeleteVoiceConnectorTerminationCredentials -> [Sensitive 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
"/termination/credentials"
        ]

instance
  Core.ToQuery
    DeleteVoiceConnectorTerminationCredentials
  where
  toQuery :: DeleteVoiceConnectorTerminationCredentials -> QueryString
toQuery =
    QueryString
-> DeleteVoiceConnectorTerminationCredentials -> QueryString
forall a b. a -> b -> a
Prelude.const
      ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"operation=delete"])

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

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

instance
  Prelude.NFData
    DeleteVoiceConnectorTerminationCredentialsResponse