{-# 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 #-}
module Amazonka.Chime.GetProxySession
(
GetProxySession (..),
newGetProxySession,
getProxySession_voiceConnectorId,
getProxySession_proxySessionId,
GetProxySessionResponse (..),
newGetProxySessionResponse,
getProxySessionResponse_proxySession,
getProxySessionResponse_httpStatus,
)
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
data GetProxySession = GetProxySession'
{
GetProxySession -> Text
voiceConnectorId :: Prelude.Text,
GetProxySession -> Text
proxySessionId :: Prelude.Text
}
deriving (GetProxySession -> GetProxySession -> Bool
(GetProxySession -> GetProxySession -> Bool)
-> (GetProxySession -> GetProxySession -> Bool)
-> Eq GetProxySession
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetProxySession -> GetProxySession -> Bool
$c/= :: GetProxySession -> GetProxySession -> Bool
== :: GetProxySession -> GetProxySession -> Bool
$c== :: GetProxySession -> GetProxySession -> Bool
Prelude.Eq, ReadPrec [GetProxySession]
ReadPrec GetProxySession
Int -> ReadS GetProxySession
ReadS [GetProxySession]
(Int -> ReadS GetProxySession)
-> ReadS [GetProxySession]
-> ReadPrec GetProxySession
-> ReadPrec [GetProxySession]
-> Read GetProxySession
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetProxySession]
$creadListPrec :: ReadPrec [GetProxySession]
readPrec :: ReadPrec GetProxySession
$creadPrec :: ReadPrec GetProxySession
readList :: ReadS [GetProxySession]
$creadList :: ReadS [GetProxySession]
readsPrec :: Int -> ReadS GetProxySession
$creadsPrec :: Int -> ReadS GetProxySession
Prelude.Read, Int -> GetProxySession -> ShowS
[GetProxySession] -> ShowS
GetProxySession -> String
(Int -> GetProxySession -> ShowS)
-> (GetProxySession -> String)
-> ([GetProxySession] -> ShowS)
-> Show GetProxySession
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetProxySession] -> ShowS
$cshowList :: [GetProxySession] -> ShowS
show :: GetProxySession -> String
$cshow :: GetProxySession -> String
showsPrec :: Int -> GetProxySession -> ShowS
$cshowsPrec :: Int -> GetProxySession -> ShowS
Prelude.Show, (forall x. GetProxySession -> Rep GetProxySession x)
-> (forall x. Rep GetProxySession x -> GetProxySession)
-> Generic GetProxySession
forall x. Rep GetProxySession x -> GetProxySession
forall x. GetProxySession -> Rep GetProxySession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetProxySession x -> GetProxySession
$cfrom :: forall x. GetProxySession -> Rep GetProxySession x
Prelude.Generic)
newGetProxySession ::
Prelude.Text ->
Prelude.Text ->
GetProxySession
newGetProxySession :: Text -> Text -> GetProxySession
newGetProxySession
Text
pVoiceConnectorId_
Text
pProxySessionId_ =
GetProxySession' :: Text -> Text -> GetProxySession
GetProxySession'
{ $sel:voiceConnectorId:GetProxySession' :: Text
voiceConnectorId =
Text
pVoiceConnectorId_,
$sel:proxySessionId:GetProxySession' :: Text
proxySessionId = Text
pProxySessionId_
}
getProxySession_voiceConnectorId :: Lens.Lens' GetProxySession Prelude.Text
getProxySession_voiceConnectorId :: (Text -> f Text) -> GetProxySession -> f GetProxySession
getProxySession_voiceConnectorId = (GetProxySession -> Text)
-> (GetProxySession -> Text -> GetProxySession)
-> Lens GetProxySession GetProxySession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProxySession' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:GetProxySession' :: GetProxySession -> Text
voiceConnectorId} -> Text
voiceConnectorId) (\s :: GetProxySession
s@GetProxySession' {} Text
a -> GetProxySession
s {$sel:voiceConnectorId:GetProxySession' :: Text
voiceConnectorId = Text
a} :: GetProxySession)
getProxySession_proxySessionId :: Lens.Lens' GetProxySession Prelude.Text
getProxySession_proxySessionId :: (Text -> f Text) -> GetProxySession -> f GetProxySession
getProxySession_proxySessionId = (GetProxySession -> Text)
-> (GetProxySession -> Text -> GetProxySession)
-> Lens GetProxySession GetProxySession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProxySession' {Text
proxySessionId :: Text
$sel:proxySessionId:GetProxySession' :: GetProxySession -> Text
proxySessionId} -> Text
proxySessionId) (\s :: GetProxySession
s@GetProxySession' {} Text
a -> GetProxySession
s {$sel:proxySessionId:GetProxySession' :: Text
proxySessionId = Text
a} :: GetProxySession)
instance Core.AWSRequest GetProxySession where
type
AWSResponse GetProxySession =
GetProxySessionResponse
request :: GetProxySession -> Request GetProxySession
request = Service -> GetProxySession -> Request GetProxySession
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetProxySession
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetProxySession)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetProxySession))
-> Logger
-> Service
-> Proxy GetProxySession
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetProxySession)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe ProxySession -> Int -> GetProxySessionResponse
GetProxySessionResponse'
(Maybe ProxySession -> Int -> GetProxySessionResponse)
-> Either String (Maybe ProxySession)
-> Either String (Int -> GetProxySessionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ProxySession)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProxySession")
Either String (Int -> GetProxySessionResponse)
-> Either String Int -> Either String GetProxySessionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetProxySession
instance Prelude.NFData GetProxySession
instance Core.ToHeaders GetProxySession where
toHeaders :: GetProxySession -> ResponseHeaders
toHeaders = ResponseHeaders -> GetProxySession -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetProxySession where
toPath :: GetProxySession -> ByteString
toPath GetProxySession' {Text
proxySessionId :: Text
voiceConnectorId :: Text
$sel:proxySessionId:GetProxySession' :: GetProxySession -> Text
$sel:voiceConnectorId:GetProxySession' :: GetProxySession -> 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 GetProxySession where
toQuery :: GetProxySession -> QueryString
toQuery = QueryString -> GetProxySession -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetProxySessionResponse = GetProxySessionResponse'
{
GetProxySessionResponse -> Maybe ProxySession
proxySession :: Prelude.Maybe ProxySession,
GetProxySessionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetProxySessionResponse -> GetProxySessionResponse -> Bool
(GetProxySessionResponse -> GetProxySessionResponse -> Bool)
-> (GetProxySessionResponse -> GetProxySessionResponse -> Bool)
-> Eq GetProxySessionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetProxySessionResponse -> GetProxySessionResponse -> Bool
$c/= :: GetProxySessionResponse -> GetProxySessionResponse -> Bool
== :: GetProxySessionResponse -> GetProxySessionResponse -> Bool
$c== :: GetProxySessionResponse -> GetProxySessionResponse -> Bool
Prelude.Eq, Int -> GetProxySessionResponse -> ShowS
[GetProxySessionResponse] -> ShowS
GetProxySessionResponse -> String
(Int -> GetProxySessionResponse -> ShowS)
-> (GetProxySessionResponse -> String)
-> ([GetProxySessionResponse] -> ShowS)
-> Show GetProxySessionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetProxySessionResponse] -> ShowS
$cshowList :: [GetProxySessionResponse] -> ShowS
show :: GetProxySessionResponse -> String
$cshow :: GetProxySessionResponse -> String
showsPrec :: Int -> GetProxySessionResponse -> ShowS
$cshowsPrec :: Int -> GetProxySessionResponse -> ShowS
Prelude.Show, (forall x.
GetProxySessionResponse -> Rep GetProxySessionResponse x)
-> (forall x.
Rep GetProxySessionResponse x -> GetProxySessionResponse)
-> Generic GetProxySessionResponse
forall x. Rep GetProxySessionResponse x -> GetProxySessionResponse
forall x. GetProxySessionResponse -> Rep GetProxySessionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetProxySessionResponse x -> GetProxySessionResponse
$cfrom :: forall x. GetProxySessionResponse -> Rep GetProxySessionResponse x
Prelude.Generic)
newGetProxySessionResponse ::
Prelude.Int ->
GetProxySessionResponse
newGetProxySessionResponse :: Int -> GetProxySessionResponse
newGetProxySessionResponse Int
pHttpStatus_ =
GetProxySessionResponse' :: Maybe ProxySession -> Int -> GetProxySessionResponse
GetProxySessionResponse'
{ $sel:proxySession:GetProxySessionResponse' :: Maybe ProxySession
proxySession =
Maybe ProxySession
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetProxySessionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getProxySessionResponse_proxySession :: Lens.Lens' GetProxySessionResponse (Prelude.Maybe ProxySession)
getProxySessionResponse_proxySession :: (Maybe ProxySession -> f (Maybe ProxySession))
-> GetProxySessionResponse -> f GetProxySessionResponse
getProxySessionResponse_proxySession = (GetProxySessionResponse -> Maybe ProxySession)
-> (GetProxySessionResponse
-> Maybe ProxySession -> GetProxySessionResponse)
-> Lens
GetProxySessionResponse
GetProxySessionResponse
(Maybe ProxySession)
(Maybe ProxySession)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProxySessionResponse' {Maybe ProxySession
proxySession :: Maybe ProxySession
$sel:proxySession:GetProxySessionResponse' :: GetProxySessionResponse -> Maybe ProxySession
proxySession} -> Maybe ProxySession
proxySession) (\s :: GetProxySessionResponse
s@GetProxySessionResponse' {} Maybe ProxySession
a -> GetProxySessionResponse
s {$sel:proxySession:GetProxySessionResponse' :: Maybe ProxySession
proxySession = Maybe ProxySession
a} :: GetProxySessionResponse)
getProxySessionResponse_httpStatus :: Lens.Lens' GetProxySessionResponse Prelude.Int
getProxySessionResponse_httpStatus :: (Int -> f Int)
-> GetProxySessionResponse -> f GetProxySessionResponse
getProxySessionResponse_httpStatus = (GetProxySessionResponse -> Int)
-> (GetProxySessionResponse -> Int -> GetProxySessionResponse)
-> Lens GetProxySessionResponse GetProxySessionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProxySessionResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetProxySessionResponse' :: GetProxySessionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetProxySessionResponse
s@GetProxySessionResponse' {} Int
a -> GetProxySessionResponse
s {$sel:httpStatus:GetProxySessionResponse' :: Int
httpStatus = Int
a} :: GetProxySessionResponse)
instance Prelude.NFData GetProxySessionResponse