{-# 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.Nimble.GetStreamingSessionStream
(
GetStreamingSessionStream (..),
newGetStreamingSessionStream,
getStreamingSessionStream_studioId,
getStreamingSessionStream_streamId,
getStreamingSessionStream_sessionId,
GetStreamingSessionStreamResponse (..),
newGetStreamingSessionStreamResponse,
getStreamingSessionStreamResponse_stream,
getStreamingSessionStreamResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Nimble.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetStreamingSessionStream = GetStreamingSessionStream'
{
GetStreamingSessionStream -> Text
studioId :: Prelude.Text,
GetStreamingSessionStream -> Text
streamId :: Prelude.Text,
GetStreamingSessionStream -> Text
sessionId :: Prelude.Text
}
deriving (GetStreamingSessionStream -> GetStreamingSessionStream -> Bool
(GetStreamingSessionStream -> GetStreamingSessionStream -> Bool)
-> (GetStreamingSessionStream -> GetStreamingSessionStream -> Bool)
-> Eq GetStreamingSessionStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetStreamingSessionStream -> GetStreamingSessionStream -> Bool
$c/= :: GetStreamingSessionStream -> GetStreamingSessionStream -> Bool
== :: GetStreamingSessionStream -> GetStreamingSessionStream -> Bool
$c== :: GetStreamingSessionStream -> GetStreamingSessionStream -> Bool
Prelude.Eq, ReadPrec [GetStreamingSessionStream]
ReadPrec GetStreamingSessionStream
Int -> ReadS GetStreamingSessionStream
ReadS [GetStreamingSessionStream]
(Int -> ReadS GetStreamingSessionStream)
-> ReadS [GetStreamingSessionStream]
-> ReadPrec GetStreamingSessionStream
-> ReadPrec [GetStreamingSessionStream]
-> Read GetStreamingSessionStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetStreamingSessionStream]
$creadListPrec :: ReadPrec [GetStreamingSessionStream]
readPrec :: ReadPrec GetStreamingSessionStream
$creadPrec :: ReadPrec GetStreamingSessionStream
readList :: ReadS [GetStreamingSessionStream]
$creadList :: ReadS [GetStreamingSessionStream]
readsPrec :: Int -> ReadS GetStreamingSessionStream
$creadsPrec :: Int -> ReadS GetStreamingSessionStream
Prelude.Read, Int -> GetStreamingSessionStream -> ShowS
[GetStreamingSessionStream] -> ShowS
GetStreamingSessionStream -> String
(Int -> GetStreamingSessionStream -> ShowS)
-> (GetStreamingSessionStream -> String)
-> ([GetStreamingSessionStream] -> ShowS)
-> Show GetStreamingSessionStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetStreamingSessionStream] -> ShowS
$cshowList :: [GetStreamingSessionStream] -> ShowS
show :: GetStreamingSessionStream -> String
$cshow :: GetStreamingSessionStream -> String
showsPrec :: Int -> GetStreamingSessionStream -> ShowS
$cshowsPrec :: Int -> GetStreamingSessionStream -> ShowS
Prelude.Show, (forall x.
GetStreamingSessionStream -> Rep GetStreamingSessionStream x)
-> (forall x.
Rep GetStreamingSessionStream x -> GetStreamingSessionStream)
-> Generic GetStreamingSessionStream
forall x.
Rep GetStreamingSessionStream x -> GetStreamingSessionStream
forall x.
GetStreamingSessionStream -> Rep GetStreamingSessionStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetStreamingSessionStream x -> GetStreamingSessionStream
$cfrom :: forall x.
GetStreamingSessionStream -> Rep GetStreamingSessionStream x
Prelude.Generic)
newGetStreamingSessionStream ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
GetStreamingSessionStream
newGetStreamingSessionStream :: Text -> Text -> Text -> GetStreamingSessionStream
newGetStreamingSessionStream
Text
pStudioId_
Text
pStreamId_
Text
pSessionId_ =
GetStreamingSessionStream' :: Text -> Text -> Text -> GetStreamingSessionStream
GetStreamingSessionStream'
{ $sel:studioId:GetStreamingSessionStream' :: Text
studioId = Text
pStudioId_,
$sel:streamId:GetStreamingSessionStream' :: Text
streamId = Text
pStreamId_,
$sel:sessionId:GetStreamingSessionStream' :: Text
sessionId = Text
pSessionId_
}
getStreamingSessionStream_studioId :: Lens.Lens' GetStreamingSessionStream Prelude.Text
getStreamingSessionStream_studioId :: (Text -> f Text)
-> GetStreamingSessionStream -> f GetStreamingSessionStream
getStreamingSessionStream_studioId = (GetStreamingSessionStream -> Text)
-> (GetStreamingSessionStream -> Text -> GetStreamingSessionStream)
-> Lens
GetStreamingSessionStream GetStreamingSessionStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingSessionStream' {Text
studioId :: Text
$sel:studioId:GetStreamingSessionStream' :: GetStreamingSessionStream -> Text
studioId} -> Text
studioId) (\s :: GetStreamingSessionStream
s@GetStreamingSessionStream' {} Text
a -> GetStreamingSessionStream
s {$sel:studioId:GetStreamingSessionStream' :: Text
studioId = Text
a} :: GetStreamingSessionStream)
getStreamingSessionStream_streamId :: Lens.Lens' GetStreamingSessionStream Prelude.Text
getStreamingSessionStream_streamId :: (Text -> f Text)
-> GetStreamingSessionStream -> f GetStreamingSessionStream
getStreamingSessionStream_streamId = (GetStreamingSessionStream -> Text)
-> (GetStreamingSessionStream -> Text -> GetStreamingSessionStream)
-> Lens
GetStreamingSessionStream GetStreamingSessionStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingSessionStream' {Text
streamId :: Text
$sel:streamId:GetStreamingSessionStream' :: GetStreamingSessionStream -> Text
streamId} -> Text
streamId) (\s :: GetStreamingSessionStream
s@GetStreamingSessionStream' {} Text
a -> GetStreamingSessionStream
s {$sel:streamId:GetStreamingSessionStream' :: Text
streamId = Text
a} :: GetStreamingSessionStream)
getStreamingSessionStream_sessionId :: Lens.Lens' GetStreamingSessionStream Prelude.Text
getStreamingSessionStream_sessionId :: (Text -> f Text)
-> GetStreamingSessionStream -> f GetStreamingSessionStream
getStreamingSessionStream_sessionId = (GetStreamingSessionStream -> Text)
-> (GetStreamingSessionStream -> Text -> GetStreamingSessionStream)
-> Lens
GetStreamingSessionStream GetStreamingSessionStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingSessionStream' {Text
sessionId :: Text
$sel:sessionId:GetStreamingSessionStream' :: GetStreamingSessionStream -> Text
sessionId} -> Text
sessionId) (\s :: GetStreamingSessionStream
s@GetStreamingSessionStream' {} Text
a -> GetStreamingSessionStream
s {$sel:sessionId:GetStreamingSessionStream' :: Text
sessionId = Text
a} :: GetStreamingSessionStream)
instance Core.AWSRequest GetStreamingSessionStream where
type
AWSResponse GetStreamingSessionStream =
GetStreamingSessionStreamResponse
request :: GetStreamingSessionStream -> Request GetStreamingSessionStream
request = Service
-> GetStreamingSessionStream -> Request GetStreamingSessionStream
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetStreamingSessionStream
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetStreamingSessionStream)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetStreamingSessionStream))
-> Logger
-> Service
-> Proxy GetStreamingSessionStream
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetStreamingSessionStream)))
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 StreamingSessionStream
-> Int -> GetStreamingSessionStreamResponse
GetStreamingSessionStreamResponse'
(Maybe StreamingSessionStream
-> Int -> GetStreamingSessionStreamResponse)
-> Either String (Maybe StreamingSessionStream)
-> Either String (Int -> GetStreamingSessionStreamResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe StreamingSessionStream)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"stream")
Either String (Int -> GetStreamingSessionStreamResponse)
-> Either String Int
-> Either String GetStreamingSessionStreamResponse
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 GetStreamingSessionStream
instance Prelude.NFData GetStreamingSessionStream
instance Core.ToHeaders GetStreamingSessionStream where
toHeaders :: GetStreamingSessionStream -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetStreamingSessionStream -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath GetStreamingSessionStream where
toPath :: GetStreamingSessionStream -> ByteString
toPath GetStreamingSessionStream' {Text
sessionId :: Text
streamId :: Text
studioId :: Text
$sel:sessionId:GetStreamingSessionStream' :: GetStreamingSessionStream -> Text
$sel:streamId:GetStreamingSessionStream' :: GetStreamingSessionStream -> Text
$sel:studioId:GetStreamingSessionStream' :: GetStreamingSessionStream -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-08-01/studios/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
studioId,
ByteString
"/streaming-sessions/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
sessionId,
ByteString
"/streams/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
streamId
]
instance Core.ToQuery GetStreamingSessionStream where
toQuery :: GetStreamingSessionStream -> QueryString
toQuery = QueryString -> GetStreamingSessionStream -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetStreamingSessionStreamResponse = GetStreamingSessionStreamResponse'
{
GetStreamingSessionStreamResponse -> Maybe StreamingSessionStream
stream :: Prelude.Maybe StreamingSessionStream,
GetStreamingSessionStreamResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetStreamingSessionStreamResponse
-> GetStreamingSessionStreamResponse -> Bool
(GetStreamingSessionStreamResponse
-> GetStreamingSessionStreamResponse -> Bool)
-> (GetStreamingSessionStreamResponse
-> GetStreamingSessionStreamResponse -> Bool)
-> Eq GetStreamingSessionStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetStreamingSessionStreamResponse
-> GetStreamingSessionStreamResponse -> Bool
$c/= :: GetStreamingSessionStreamResponse
-> GetStreamingSessionStreamResponse -> Bool
== :: GetStreamingSessionStreamResponse
-> GetStreamingSessionStreamResponse -> Bool
$c== :: GetStreamingSessionStreamResponse
-> GetStreamingSessionStreamResponse -> Bool
Prelude.Eq, ReadPrec [GetStreamingSessionStreamResponse]
ReadPrec GetStreamingSessionStreamResponse
Int -> ReadS GetStreamingSessionStreamResponse
ReadS [GetStreamingSessionStreamResponse]
(Int -> ReadS GetStreamingSessionStreamResponse)
-> ReadS [GetStreamingSessionStreamResponse]
-> ReadPrec GetStreamingSessionStreamResponse
-> ReadPrec [GetStreamingSessionStreamResponse]
-> Read GetStreamingSessionStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetStreamingSessionStreamResponse]
$creadListPrec :: ReadPrec [GetStreamingSessionStreamResponse]
readPrec :: ReadPrec GetStreamingSessionStreamResponse
$creadPrec :: ReadPrec GetStreamingSessionStreamResponse
readList :: ReadS [GetStreamingSessionStreamResponse]
$creadList :: ReadS [GetStreamingSessionStreamResponse]
readsPrec :: Int -> ReadS GetStreamingSessionStreamResponse
$creadsPrec :: Int -> ReadS GetStreamingSessionStreamResponse
Prelude.Read, Int -> GetStreamingSessionStreamResponse -> ShowS
[GetStreamingSessionStreamResponse] -> ShowS
GetStreamingSessionStreamResponse -> String
(Int -> GetStreamingSessionStreamResponse -> ShowS)
-> (GetStreamingSessionStreamResponse -> String)
-> ([GetStreamingSessionStreamResponse] -> ShowS)
-> Show GetStreamingSessionStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetStreamingSessionStreamResponse] -> ShowS
$cshowList :: [GetStreamingSessionStreamResponse] -> ShowS
show :: GetStreamingSessionStreamResponse -> String
$cshow :: GetStreamingSessionStreamResponse -> String
showsPrec :: Int -> GetStreamingSessionStreamResponse -> ShowS
$cshowsPrec :: Int -> GetStreamingSessionStreamResponse -> ShowS
Prelude.Show, (forall x.
GetStreamingSessionStreamResponse
-> Rep GetStreamingSessionStreamResponse x)
-> (forall x.
Rep GetStreamingSessionStreamResponse x
-> GetStreamingSessionStreamResponse)
-> Generic GetStreamingSessionStreamResponse
forall x.
Rep GetStreamingSessionStreamResponse x
-> GetStreamingSessionStreamResponse
forall x.
GetStreamingSessionStreamResponse
-> Rep GetStreamingSessionStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetStreamingSessionStreamResponse x
-> GetStreamingSessionStreamResponse
$cfrom :: forall x.
GetStreamingSessionStreamResponse
-> Rep GetStreamingSessionStreamResponse x
Prelude.Generic)
newGetStreamingSessionStreamResponse ::
Prelude.Int ->
GetStreamingSessionStreamResponse
newGetStreamingSessionStreamResponse :: Int -> GetStreamingSessionStreamResponse
newGetStreamingSessionStreamResponse Int
pHttpStatus_ =
GetStreamingSessionStreamResponse' :: Maybe StreamingSessionStream
-> Int -> GetStreamingSessionStreamResponse
GetStreamingSessionStreamResponse'
{ $sel:stream:GetStreamingSessionStreamResponse' :: Maybe StreamingSessionStream
stream =
Maybe StreamingSessionStream
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetStreamingSessionStreamResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getStreamingSessionStreamResponse_stream :: Lens.Lens' GetStreamingSessionStreamResponse (Prelude.Maybe StreamingSessionStream)
getStreamingSessionStreamResponse_stream :: (Maybe StreamingSessionStream -> f (Maybe StreamingSessionStream))
-> GetStreamingSessionStreamResponse
-> f GetStreamingSessionStreamResponse
getStreamingSessionStreamResponse_stream = (GetStreamingSessionStreamResponse -> Maybe StreamingSessionStream)
-> (GetStreamingSessionStreamResponse
-> Maybe StreamingSessionStream
-> GetStreamingSessionStreamResponse)
-> Lens
GetStreamingSessionStreamResponse
GetStreamingSessionStreamResponse
(Maybe StreamingSessionStream)
(Maybe StreamingSessionStream)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingSessionStreamResponse' {Maybe StreamingSessionStream
stream :: Maybe StreamingSessionStream
$sel:stream:GetStreamingSessionStreamResponse' :: GetStreamingSessionStreamResponse -> Maybe StreamingSessionStream
stream} -> Maybe StreamingSessionStream
stream) (\s :: GetStreamingSessionStreamResponse
s@GetStreamingSessionStreamResponse' {} Maybe StreamingSessionStream
a -> GetStreamingSessionStreamResponse
s {$sel:stream:GetStreamingSessionStreamResponse' :: Maybe StreamingSessionStream
stream = Maybe StreamingSessionStream
a} :: GetStreamingSessionStreamResponse)
getStreamingSessionStreamResponse_httpStatus :: Lens.Lens' GetStreamingSessionStreamResponse Prelude.Int
getStreamingSessionStreamResponse_httpStatus :: (Int -> f Int)
-> GetStreamingSessionStreamResponse
-> f GetStreamingSessionStreamResponse
getStreamingSessionStreamResponse_httpStatus = (GetStreamingSessionStreamResponse -> Int)
-> (GetStreamingSessionStreamResponse
-> Int -> GetStreamingSessionStreamResponse)
-> Lens
GetStreamingSessionStreamResponse
GetStreamingSessionStreamResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingSessionStreamResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetStreamingSessionStreamResponse' :: GetStreamingSessionStreamResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetStreamingSessionStreamResponse
s@GetStreamingSessionStreamResponse' {} Int
a -> GetStreamingSessionStreamResponse
s {$sel:httpStatus:GetStreamingSessionStreamResponse' :: Int
httpStatus = Int
a} :: GetStreamingSessionStreamResponse)
instance
Prelude.NFData
GetStreamingSessionStreamResponse