{-# 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.DeleteProxySession
-- 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 proxy session from the specified Amazon Chime
-- Voice Connector.
module Amazonka.Chime.DeleteProxySession
  ( -- * Creating a Request
    DeleteProxySession (..),
    newDeleteProxySession,

    -- * Request Lenses
    deleteProxySession_voiceConnectorId,
    deleteProxySession_proxySessionId,

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

-- |
-- Create a value of 'DeleteProxySession' 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', 'deleteProxySession_voiceConnectorId' - The Amazon Chime voice connector ID.
--
-- 'proxySessionId', 'deleteProxySession_proxySessionId' - The proxy session ID.
newDeleteProxySession ::
  -- | 'voiceConnectorId'
  Prelude.Text ->
  -- | 'proxySessionId'
  Prelude.Text ->
  DeleteProxySession
newDeleteProxySession :: Text -> Text -> DeleteProxySession
newDeleteProxySession
  Text
pVoiceConnectorId_
  Text
pProxySessionId_ =
    DeleteProxySession' :: Text -> Text -> DeleteProxySession
DeleteProxySession'
      { $sel:voiceConnectorId:DeleteProxySession' :: Text
voiceConnectorId =
          Text
pVoiceConnectorId_,
        $sel:proxySessionId:DeleteProxySession' :: Text
proxySessionId = Text
pProxySessionId_
      }

-- | The Amazon Chime voice connector ID.
deleteProxySession_voiceConnectorId :: Lens.Lens' DeleteProxySession Prelude.Text
deleteProxySession_voiceConnectorId :: (Text -> f Text) -> DeleteProxySession -> f DeleteProxySession
deleteProxySession_voiceConnectorId = (DeleteProxySession -> Text)
-> (DeleteProxySession -> Text -> DeleteProxySession)
-> Lens DeleteProxySession DeleteProxySession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProxySession' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:DeleteProxySession' :: DeleteProxySession -> Text
voiceConnectorId} -> Text
voiceConnectorId) (\s :: DeleteProxySession
s@DeleteProxySession' {} Text
a -> DeleteProxySession
s {$sel:voiceConnectorId:DeleteProxySession' :: Text
voiceConnectorId = Text
a} :: DeleteProxySession)

-- | The proxy session ID.
deleteProxySession_proxySessionId :: Lens.Lens' DeleteProxySession Prelude.Text
deleteProxySession_proxySessionId :: (Text -> f Text) -> DeleteProxySession -> f DeleteProxySession
deleteProxySession_proxySessionId = (DeleteProxySession -> Text)
-> (DeleteProxySession -> Text -> DeleteProxySession)
-> Lens DeleteProxySession DeleteProxySession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProxySession' {Text
proxySessionId :: Text
$sel:proxySessionId:DeleteProxySession' :: DeleteProxySession -> Text
proxySessionId} -> Text
proxySessionId) (\s :: DeleteProxySession
s@DeleteProxySession' {} Text
a -> DeleteProxySession
s {$sel:proxySessionId:DeleteProxySession' :: Text
proxySessionId = Text
a} :: DeleteProxySession)

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

instance Prelude.Hashable DeleteProxySession

instance Prelude.NFData DeleteProxySession

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

instance Core.ToPath DeleteProxySession where
  toPath :: DeleteProxySession -> ByteString
toPath DeleteProxySession' {Text
proxySessionId :: Text
voiceConnectorId :: Text
$sel:proxySessionId:DeleteProxySession' :: DeleteProxySession -> Text
$sel:voiceConnectorId:DeleteProxySession' :: DeleteProxySession -> 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
"/proxy-sessions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
proxySessionId
      ]

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

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

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

instance Prelude.NFData DeleteProxySessionResponse