{-# 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.GameLift.GetGameSessionLogUrl
(
GetGameSessionLogUrl (..),
newGetGameSessionLogUrl,
getGameSessionLogUrl_gameSessionId,
GetGameSessionLogUrlResponse (..),
newGetGameSessionLogUrlResponse,
getGameSessionLogUrlResponse_preSignedUrl,
getGameSessionLogUrlResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types
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 GetGameSessionLogUrl = GetGameSessionLogUrl'
{
GetGameSessionLogUrl -> Text
gameSessionId :: Prelude.Text
}
deriving (GetGameSessionLogUrl -> GetGameSessionLogUrl -> Bool
(GetGameSessionLogUrl -> GetGameSessionLogUrl -> Bool)
-> (GetGameSessionLogUrl -> GetGameSessionLogUrl -> Bool)
-> Eq GetGameSessionLogUrl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetGameSessionLogUrl -> GetGameSessionLogUrl -> Bool
$c/= :: GetGameSessionLogUrl -> GetGameSessionLogUrl -> Bool
== :: GetGameSessionLogUrl -> GetGameSessionLogUrl -> Bool
$c== :: GetGameSessionLogUrl -> GetGameSessionLogUrl -> Bool
Prelude.Eq, ReadPrec [GetGameSessionLogUrl]
ReadPrec GetGameSessionLogUrl
Int -> ReadS GetGameSessionLogUrl
ReadS [GetGameSessionLogUrl]
(Int -> ReadS GetGameSessionLogUrl)
-> ReadS [GetGameSessionLogUrl]
-> ReadPrec GetGameSessionLogUrl
-> ReadPrec [GetGameSessionLogUrl]
-> Read GetGameSessionLogUrl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetGameSessionLogUrl]
$creadListPrec :: ReadPrec [GetGameSessionLogUrl]
readPrec :: ReadPrec GetGameSessionLogUrl
$creadPrec :: ReadPrec GetGameSessionLogUrl
readList :: ReadS [GetGameSessionLogUrl]
$creadList :: ReadS [GetGameSessionLogUrl]
readsPrec :: Int -> ReadS GetGameSessionLogUrl
$creadsPrec :: Int -> ReadS GetGameSessionLogUrl
Prelude.Read, Int -> GetGameSessionLogUrl -> ShowS
[GetGameSessionLogUrl] -> ShowS
GetGameSessionLogUrl -> String
(Int -> GetGameSessionLogUrl -> ShowS)
-> (GetGameSessionLogUrl -> String)
-> ([GetGameSessionLogUrl] -> ShowS)
-> Show GetGameSessionLogUrl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetGameSessionLogUrl] -> ShowS
$cshowList :: [GetGameSessionLogUrl] -> ShowS
show :: GetGameSessionLogUrl -> String
$cshow :: GetGameSessionLogUrl -> String
showsPrec :: Int -> GetGameSessionLogUrl -> ShowS
$cshowsPrec :: Int -> GetGameSessionLogUrl -> ShowS
Prelude.Show, (forall x. GetGameSessionLogUrl -> Rep GetGameSessionLogUrl x)
-> (forall x. Rep GetGameSessionLogUrl x -> GetGameSessionLogUrl)
-> Generic GetGameSessionLogUrl
forall x. Rep GetGameSessionLogUrl x -> GetGameSessionLogUrl
forall x. GetGameSessionLogUrl -> Rep GetGameSessionLogUrl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetGameSessionLogUrl x -> GetGameSessionLogUrl
$cfrom :: forall x. GetGameSessionLogUrl -> Rep GetGameSessionLogUrl x
Prelude.Generic)
newGetGameSessionLogUrl ::
Prelude.Text ->
GetGameSessionLogUrl
newGetGameSessionLogUrl :: Text -> GetGameSessionLogUrl
newGetGameSessionLogUrl Text
pGameSessionId_ =
GetGameSessionLogUrl' :: Text -> GetGameSessionLogUrl
GetGameSessionLogUrl'
{ $sel:gameSessionId:GetGameSessionLogUrl' :: Text
gameSessionId =
Text
pGameSessionId_
}
getGameSessionLogUrl_gameSessionId :: Lens.Lens' GetGameSessionLogUrl Prelude.Text
getGameSessionLogUrl_gameSessionId :: (Text -> f Text) -> GetGameSessionLogUrl -> f GetGameSessionLogUrl
getGameSessionLogUrl_gameSessionId = (GetGameSessionLogUrl -> Text)
-> (GetGameSessionLogUrl -> Text -> GetGameSessionLogUrl)
-> Lens GetGameSessionLogUrl GetGameSessionLogUrl Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGameSessionLogUrl' {Text
gameSessionId :: Text
$sel:gameSessionId:GetGameSessionLogUrl' :: GetGameSessionLogUrl -> Text
gameSessionId} -> Text
gameSessionId) (\s :: GetGameSessionLogUrl
s@GetGameSessionLogUrl' {} Text
a -> GetGameSessionLogUrl
s {$sel:gameSessionId:GetGameSessionLogUrl' :: Text
gameSessionId = Text
a} :: GetGameSessionLogUrl)
instance Core.AWSRequest GetGameSessionLogUrl where
type
AWSResponse GetGameSessionLogUrl =
GetGameSessionLogUrlResponse
request :: GetGameSessionLogUrl -> Request GetGameSessionLogUrl
request = Service -> GetGameSessionLogUrl -> Request GetGameSessionLogUrl
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetGameSessionLogUrl
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetGameSessionLogUrl)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetGameSessionLogUrl))
-> Logger
-> Service
-> Proxy GetGameSessionLogUrl
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetGameSessionLogUrl)))
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 Text -> Int -> GetGameSessionLogUrlResponse
GetGameSessionLogUrlResponse'
(Maybe Text -> Int -> GetGameSessionLogUrlResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetGameSessionLogUrlResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PreSignedUrl")
Either String (Int -> GetGameSessionLogUrlResponse)
-> Either String Int -> Either String GetGameSessionLogUrlResponse
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 GetGameSessionLogUrl
instance Prelude.NFData GetGameSessionLogUrl
instance Core.ToHeaders GetGameSessionLogUrl where
toHeaders :: GetGameSessionLogUrl -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetGameSessionLogUrl -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"GameLift.GetGameSessionLogUrl" ::
Prelude.ByteString
),
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.ToJSON GetGameSessionLogUrl where
toJSON :: GetGameSessionLogUrl -> Value
toJSON GetGameSessionLogUrl' {Text
gameSessionId :: Text
$sel:gameSessionId:GetGameSessionLogUrl' :: GetGameSessionLogUrl -> 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
"GameSessionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gameSessionId)
]
)
instance Core.ToPath GetGameSessionLogUrl where
toPath :: GetGameSessionLogUrl -> ByteString
toPath = ByteString -> GetGameSessionLogUrl -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetGameSessionLogUrl where
toQuery :: GetGameSessionLogUrl -> QueryString
toQuery = QueryString -> GetGameSessionLogUrl -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetGameSessionLogUrlResponse = GetGameSessionLogUrlResponse'
{
GetGameSessionLogUrlResponse -> Maybe Text
preSignedUrl :: Prelude.Maybe Prelude.Text,
GetGameSessionLogUrlResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetGameSessionLogUrlResponse
-> GetGameSessionLogUrlResponse -> Bool
(GetGameSessionLogUrlResponse
-> GetGameSessionLogUrlResponse -> Bool)
-> (GetGameSessionLogUrlResponse
-> GetGameSessionLogUrlResponse -> Bool)
-> Eq GetGameSessionLogUrlResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetGameSessionLogUrlResponse
-> GetGameSessionLogUrlResponse -> Bool
$c/= :: GetGameSessionLogUrlResponse
-> GetGameSessionLogUrlResponse -> Bool
== :: GetGameSessionLogUrlResponse
-> GetGameSessionLogUrlResponse -> Bool
$c== :: GetGameSessionLogUrlResponse
-> GetGameSessionLogUrlResponse -> Bool
Prelude.Eq, ReadPrec [GetGameSessionLogUrlResponse]
ReadPrec GetGameSessionLogUrlResponse
Int -> ReadS GetGameSessionLogUrlResponse
ReadS [GetGameSessionLogUrlResponse]
(Int -> ReadS GetGameSessionLogUrlResponse)
-> ReadS [GetGameSessionLogUrlResponse]
-> ReadPrec GetGameSessionLogUrlResponse
-> ReadPrec [GetGameSessionLogUrlResponse]
-> Read GetGameSessionLogUrlResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetGameSessionLogUrlResponse]
$creadListPrec :: ReadPrec [GetGameSessionLogUrlResponse]
readPrec :: ReadPrec GetGameSessionLogUrlResponse
$creadPrec :: ReadPrec GetGameSessionLogUrlResponse
readList :: ReadS [GetGameSessionLogUrlResponse]
$creadList :: ReadS [GetGameSessionLogUrlResponse]
readsPrec :: Int -> ReadS GetGameSessionLogUrlResponse
$creadsPrec :: Int -> ReadS GetGameSessionLogUrlResponse
Prelude.Read, Int -> GetGameSessionLogUrlResponse -> ShowS
[GetGameSessionLogUrlResponse] -> ShowS
GetGameSessionLogUrlResponse -> String
(Int -> GetGameSessionLogUrlResponse -> ShowS)
-> (GetGameSessionLogUrlResponse -> String)
-> ([GetGameSessionLogUrlResponse] -> ShowS)
-> Show GetGameSessionLogUrlResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetGameSessionLogUrlResponse] -> ShowS
$cshowList :: [GetGameSessionLogUrlResponse] -> ShowS
show :: GetGameSessionLogUrlResponse -> String
$cshow :: GetGameSessionLogUrlResponse -> String
showsPrec :: Int -> GetGameSessionLogUrlResponse -> ShowS
$cshowsPrec :: Int -> GetGameSessionLogUrlResponse -> ShowS
Prelude.Show, (forall x.
GetGameSessionLogUrlResponse -> Rep GetGameSessionLogUrlResponse x)
-> (forall x.
Rep GetGameSessionLogUrlResponse x -> GetGameSessionLogUrlResponse)
-> Generic GetGameSessionLogUrlResponse
forall x.
Rep GetGameSessionLogUrlResponse x -> GetGameSessionLogUrlResponse
forall x.
GetGameSessionLogUrlResponse -> Rep GetGameSessionLogUrlResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetGameSessionLogUrlResponse x -> GetGameSessionLogUrlResponse
$cfrom :: forall x.
GetGameSessionLogUrlResponse -> Rep GetGameSessionLogUrlResponse x
Prelude.Generic)
newGetGameSessionLogUrlResponse ::
Prelude.Int ->
GetGameSessionLogUrlResponse
newGetGameSessionLogUrlResponse :: Int -> GetGameSessionLogUrlResponse
newGetGameSessionLogUrlResponse Int
pHttpStatus_ =
GetGameSessionLogUrlResponse' :: Maybe Text -> Int -> GetGameSessionLogUrlResponse
GetGameSessionLogUrlResponse'
{ $sel:preSignedUrl:GetGameSessionLogUrlResponse' :: Maybe Text
preSignedUrl =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetGameSessionLogUrlResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getGameSessionLogUrlResponse_preSignedUrl :: Lens.Lens' GetGameSessionLogUrlResponse (Prelude.Maybe Prelude.Text)
getGameSessionLogUrlResponse_preSignedUrl :: (Maybe Text -> f (Maybe Text))
-> GetGameSessionLogUrlResponse -> f GetGameSessionLogUrlResponse
getGameSessionLogUrlResponse_preSignedUrl = (GetGameSessionLogUrlResponse -> Maybe Text)
-> (GetGameSessionLogUrlResponse
-> Maybe Text -> GetGameSessionLogUrlResponse)
-> Lens
GetGameSessionLogUrlResponse
GetGameSessionLogUrlResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGameSessionLogUrlResponse' {Maybe Text
preSignedUrl :: Maybe Text
$sel:preSignedUrl:GetGameSessionLogUrlResponse' :: GetGameSessionLogUrlResponse -> Maybe Text
preSignedUrl} -> Maybe Text
preSignedUrl) (\s :: GetGameSessionLogUrlResponse
s@GetGameSessionLogUrlResponse' {} Maybe Text
a -> GetGameSessionLogUrlResponse
s {$sel:preSignedUrl:GetGameSessionLogUrlResponse' :: Maybe Text
preSignedUrl = Maybe Text
a} :: GetGameSessionLogUrlResponse)
getGameSessionLogUrlResponse_httpStatus :: Lens.Lens' GetGameSessionLogUrlResponse Prelude.Int
getGameSessionLogUrlResponse_httpStatus :: (Int -> f Int)
-> GetGameSessionLogUrlResponse -> f GetGameSessionLogUrlResponse
getGameSessionLogUrlResponse_httpStatus = (GetGameSessionLogUrlResponse -> Int)
-> (GetGameSessionLogUrlResponse
-> Int -> GetGameSessionLogUrlResponse)
-> Lens
GetGameSessionLogUrlResponse GetGameSessionLogUrlResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGameSessionLogUrlResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetGameSessionLogUrlResponse' :: GetGameSessionLogUrlResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetGameSessionLogUrlResponse
s@GetGameSessionLogUrlResponse' {} Int
a -> GetGameSessionLogUrlResponse
s {$sel:httpStatus:GetGameSessionLogUrlResponse' :: Int
httpStatus = Int
a} :: GetGameSessionLogUrlResponse)
instance Prelude.NFData GetGameSessionLogUrlResponse