{-# 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.DescribeGameSessions
(
DescribeGameSessions (..),
newDescribeGameSessions,
describeGameSessions_location,
describeGameSessions_gameSessionId,
describeGameSessions_aliasId,
describeGameSessions_nextToken,
describeGameSessions_statusFilter,
describeGameSessions_limit,
describeGameSessions_fleetId,
DescribeGameSessionsResponse (..),
newDescribeGameSessionsResponse,
describeGameSessionsResponse_gameSessions,
describeGameSessionsResponse_nextToken,
describeGameSessionsResponse_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 DescribeGameSessions = DescribeGameSessions'
{
DescribeGameSessions -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
DescribeGameSessions -> Maybe Text
gameSessionId :: Prelude.Maybe Prelude.Text,
DescribeGameSessions -> Maybe Text
aliasId :: Prelude.Maybe Prelude.Text,
DescribeGameSessions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeGameSessions -> Maybe Text
statusFilter :: Prelude.Maybe Prelude.Text,
DescribeGameSessions -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
DescribeGameSessions -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text
}
deriving (DescribeGameSessions -> DescribeGameSessions -> Bool
(DescribeGameSessions -> DescribeGameSessions -> Bool)
-> (DescribeGameSessions -> DescribeGameSessions -> Bool)
-> Eq DescribeGameSessions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGameSessions -> DescribeGameSessions -> Bool
$c/= :: DescribeGameSessions -> DescribeGameSessions -> Bool
== :: DescribeGameSessions -> DescribeGameSessions -> Bool
$c== :: DescribeGameSessions -> DescribeGameSessions -> Bool
Prelude.Eq, ReadPrec [DescribeGameSessions]
ReadPrec DescribeGameSessions
Int -> ReadS DescribeGameSessions
ReadS [DescribeGameSessions]
(Int -> ReadS DescribeGameSessions)
-> ReadS [DescribeGameSessions]
-> ReadPrec DescribeGameSessions
-> ReadPrec [DescribeGameSessions]
-> Read DescribeGameSessions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGameSessions]
$creadListPrec :: ReadPrec [DescribeGameSessions]
readPrec :: ReadPrec DescribeGameSessions
$creadPrec :: ReadPrec DescribeGameSessions
readList :: ReadS [DescribeGameSessions]
$creadList :: ReadS [DescribeGameSessions]
readsPrec :: Int -> ReadS DescribeGameSessions
$creadsPrec :: Int -> ReadS DescribeGameSessions
Prelude.Read, Int -> DescribeGameSessions -> ShowS
[DescribeGameSessions] -> ShowS
DescribeGameSessions -> String
(Int -> DescribeGameSessions -> ShowS)
-> (DescribeGameSessions -> String)
-> ([DescribeGameSessions] -> ShowS)
-> Show DescribeGameSessions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGameSessions] -> ShowS
$cshowList :: [DescribeGameSessions] -> ShowS
show :: DescribeGameSessions -> String
$cshow :: DescribeGameSessions -> String
showsPrec :: Int -> DescribeGameSessions -> ShowS
$cshowsPrec :: Int -> DescribeGameSessions -> ShowS
Prelude.Show, (forall x. DescribeGameSessions -> Rep DescribeGameSessions x)
-> (forall x. Rep DescribeGameSessions x -> DescribeGameSessions)
-> Generic DescribeGameSessions
forall x. Rep DescribeGameSessions x -> DescribeGameSessions
forall x. DescribeGameSessions -> Rep DescribeGameSessions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeGameSessions x -> DescribeGameSessions
$cfrom :: forall x. DescribeGameSessions -> Rep DescribeGameSessions x
Prelude.Generic)
newDescribeGameSessions ::
DescribeGameSessions
newDescribeGameSessions :: DescribeGameSessions
newDescribeGameSessions =
DescribeGameSessions' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> DescribeGameSessions
DescribeGameSessions'
{ $sel:location:DescribeGameSessions' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gameSessionId:DescribeGameSessions' :: Maybe Text
gameSessionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:aliasId:DescribeGameSessions' :: Maybe Text
aliasId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:DescribeGameSessions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:statusFilter:DescribeGameSessions' :: Maybe Text
statusFilter = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:limit:DescribeGameSessions' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:DescribeGameSessions' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
describeGameSessions_location :: Lens.Lens' DescribeGameSessions (Prelude.Maybe Prelude.Text)
describeGameSessions_location :: (Maybe Text -> f (Maybe Text))
-> DescribeGameSessions -> f DescribeGameSessions
describeGameSessions_location = (DescribeGameSessions -> Maybe Text)
-> (DescribeGameSessions -> Maybe Text -> DescribeGameSessions)
-> Lens
DescribeGameSessions DescribeGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessions' {Maybe Text
location :: Maybe Text
$sel:location:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
location} -> Maybe Text
location) (\s :: DescribeGameSessions
s@DescribeGameSessions' {} Maybe Text
a -> DescribeGameSessions
s {$sel:location:DescribeGameSessions' :: Maybe Text
location = Maybe Text
a} :: DescribeGameSessions)
describeGameSessions_gameSessionId :: Lens.Lens' DescribeGameSessions (Prelude.Maybe Prelude.Text)
describeGameSessions_gameSessionId :: (Maybe Text -> f (Maybe Text))
-> DescribeGameSessions -> f DescribeGameSessions
describeGameSessions_gameSessionId = (DescribeGameSessions -> Maybe Text)
-> (DescribeGameSessions -> Maybe Text -> DescribeGameSessions)
-> Lens
DescribeGameSessions DescribeGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessions' {Maybe Text
gameSessionId :: Maybe Text
$sel:gameSessionId:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
gameSessionId} -> Maybe Text
gameSessionId) (\s :: DescribeGameSessions
s@DescribeGameSessions' {} Maybe Text
a -> DescribeGameSessions
s {$sel:gameSessionId:DescribeGameSessions' :: Maybe Text
gameSessionId = Maybe Text
a} :: DescribeGameSessions)
describeGameSessions_aliasId :: Lens.Lens' DescribeGameSessions (Prelude.Maybe Prelude.Text)
describeGameSessions_aliasId :: (Maybe Text -> f (Maybe Text))
-> DescribeGameSessions -> f DescribeGameSessions
describeGameSessions_aliasId = (DescribeGameSessions -> Maybe Text)
-> (DescribeGameSessions -> Maybe Text -> DescribeGameSessions)
-> Lens
DescribeGameSessions DescribeGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessions' {Maybe Text
aliasId :: Maybe Text
$sel:aliasId:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
aliasId} -> Maybe Text
aliasId) (\s :: DescribeGameSessions
s@DescribeGameSessions' {} Maybe Text
a -> DescribeGameSessions
s {$sel:aliasId:DescribeGameSessions' :: Maybe Text
aliasId = Maybe Text
a} :: DescribeGameSessions)
describeGameSessions_nextToken :: Lens.Lens' DescribeGameSessions (Prelude.Maybe Prelude.Text)
describeGameSessions_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeGameSessions -> f DescribeGameSessions
describeGameSessions_nextToken = (DescribeGameSessions -> Maybe Text)
-> (DescribeGameSessions -> Maybe Text -> DescribeGameSessions)
-> Lens
DescribeGameSessions DescribeGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeGameSessions
s@DescribeGameSessions' {} Maybe Text
a -> DescribeGameSessions
s {$sel:nextToken:DescribeGameSessions' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeGameSessions)
describeGameSessions_statusFilter :: Lens.Lens' DescribeGameSessions (Prelude.Maybe Prelude.Text)
describeGameSessions_statusFilter :: (Maybe Text -> f (Maybe Text))
-> DescribeGameSessions -> f DescribeGameSessions
describeGameSessions_statusFilter = (DescribeGameSessions -> Maybe Text)
-> (DescribeGameSessions -> Maybe Text -> DescribeGameSessions)
-> Lens
DescribeGameSessions DescribeGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessions' {Maybe Text
statusFilter :: Maybe Text
$sel:statusFilter:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
statusFilter} -> Maybe Text
statusFilter) (\s :: DescribeGameSessions
s@DescribeGameSessions' {} Maybe Text
a -> DescribeGameSessions
s {$sel:statusFilter:DescribeGameSessions' :: Maybe Text
statusFilter = Maybe Text
a} :: DescribeGameSessions)
describeGameSessions_limit :: Lens.Lens' DescribeGameSessions (Prelude.Maybe Prelude.Natural)
describeGameSessions_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeGameSessions -> f DescribeGameSessions
describeGameSessions_limit = (DescribeGameSessions -> Maybe Natural)
-> (DescribeGameSessions -> Maybe Natural -> DescribeGameSessions)
-> Lens
DescribeGameSessions
DescribeGameSessions
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessions' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeGameSessions' :: DescribeGameSessions -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeGameSessions
s@DescribeGameSessions' {} Maybe Natural
a -> DescribeGameSessions
s {$sel:limit:DescribeGameSessions' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeGameSessions)
describeGameSessions_fleetId :: Lens.Lens' DescribeGameSessions (Prelude.Maybe Prelude.Text)
describeGameSessions_fleetId :: (Maybe Text -> f (Maybe Text))
-> DescribeGameSessions -> f DescribeGameSessions
describeGameSessions_fleetId = (DescribeGameSessions -> Maybe Text)
-> (DescribeGameSessions -> Maybe Text -> DescribeGameSessions)
-> Lens
DescribeGameSessions DescribeGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessions' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: DescribeGameSessions
s@DescribeGameSessions' {} Maybe Text
a -> DescribeGameSessions
s {$sel:fleetId:DescribeGameSessions' :: Maybe Text
fleetId = Maybe Text
a} :: DescribeGameSessions)
instance Core.AWSPager DescribeGameSessions where
page :: DescribeGameSessions
-> AWSResponse DescribeGameSessions -> Maybe DescribeGameSessions
page DescribeGameSessions
rq AWSResponse DescribeGameSessions
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeGameSessions
DescribeGameSessionsResponse
rs
DescribeGameSessionsResponse
-> Getting (First Text) DescribeGameSessionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeGameSessionsResponse
-> Const (First Text) DescribeGameSessionsResponse
Lens' DescribeGameSessionsResponse (Maybe Text)
describeGameSessionsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeGameSessionsResponse
-> Const (First Text) DescribeGameSessionsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeGameSessionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeGameSessions
forall a. Maybe a
Prelude.Nothing
| Maybe [GameSession] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeGameSessions
DescribeGameSessionsResponse
rs
DescribeGameSessionsResponse
-> Getting
(First [GameSession]) DescribeGameSessionsResponse [GameSession]
-> Maybe [GameSession]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [GameSession]
-> Const (First [GameSession]) (Maybe [GameSession]))
-> DescribeGameSessionsResponse
-> Const (First [GameSession]) DescribeGameSessionsResponse
Lens' DescribeGameSessionsResponse (Maybe [GameSession])
describeGameSessionsResponse_gameSessions
((Maybe [GameSession]
-> Const (First [GameSession]) (Maybe [GameSession]))
-> DescribeGameSessionsResponse
-> Const (First [GameSession]) DescribeGameSessionsResponse)
-> (([GameSession] -> Const (First [GameSession]) [GameSession])
-> Maybe [GameSession]
-> Const (First [GameSession]) (Maybe [GameSession]))
-> Getting
(First [GameSession]) DescribeGameSessionsResponse [GameSession]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([GameSession] -> Const (First [GameSession]) [GameSession])
-> Maybe [GameSession]
-> Const (First [GameSession]) (Maybe [GameSession])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeGameSessions
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
DescribeGameSessions -> Maybe DescribeGameSessions
forall a. a -> Maybe a
Prelude.Just (DescribeGameSessions -> Maybe DescribeGameSessions)
-> DescribeGameSessions -> Maybe DescribeGameSessions
forall a b. (a -> b) -> a -> b
Prelude.$
DescribeGameSessions
rq
DescribeGameSessions
-> (DescribeGameSessions -> DescribeGameSessions)
-> DescribeGameSessions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeGameSessions -> Identity DescribeGameSessions
Lens
DescribeGameSessions DescribeGameSessions (Maybe Text) (Maybe Text)
describeGameSessions_nextToken
((Maybe Text -> Identity (Maybe Text))
-> DescribeGameSessions -> Identity DescribeGameSessions)
-> Maybe Text -> DescribeGameSessions -> DescribeGameSessions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeGameSessions
DescribeGameSessionsResponse
rs
DescribeGameSessionsResponse
-> Getting (First Text) DescribeGameSessionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeGameSessionsResponse
-> Const (First Text) DescribeGameSessionsResponse
Lens' DescribeGameSessionsResponse (Maybe Text)
describeGameSessionsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeGameSessionsResponse
-> Const (First Text) DescribeGameSessionsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeGameSessionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest DescribeGameSessions where
type
AWSResponse DescribeGameSessions =
DescribeGameSessionsResponse
request :: DescribeGameSessions -> Request DescribeGameSessions
request = Service -> DescribeGameSessions -> Request DescribeGameSessions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeGameSessions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeGameSessions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeGameSessions))
-> Logger
-> Service
-> Proxy DescribeGameSessions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeGameSessions)))
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 [GameSession]
-> Maybe Text -> Int -> DescribeGameSessionsResponse
DescribeGameSessionsResponse'
(Maybe [GameSession]
-> Maybe Text -> Int -> DescribeGameSessionsResponse)
-> Either String (Maybe [GameSession])
-> Either
String (Maybe Text -> Int -> DescribeGameSessionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [GameSession]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GameSessions" Either String (Maybe (Maybe [GameSession]))
-> Maybe [GameSession] -> Either String (Maybe [GameSession])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [GameSession]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> DescribeGameSessionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeGameSessionsResponse)
forall (f :: * -> *) a b. Applicative f => 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
"NextToken")
Either String (Int -> DescribeGameSessionsResponse)
-> Either String Int -> Either String DescribeGameSessionsResponse
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 DescribeGameSessions
instance Prelude.NFData DescribeGameSessions
instance Core.ToHeaders DescribeGameSessions where
toHeaders :: DescribeGameSessions -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeGameSessions -> 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.DescribeGameSessions" ::
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 DescribeGameSessions where
toJSON :: DescribeGameSessions -> Value
toJSON DescribeGameSessions' {Maybe Natural
Maybe Text
fleetId :: Maybe Text
limit :: Maybe Natural
statusFilter :: Maybe Text
nextToken :: Maybe Text
aliasId :: Maybe Text
gameSessionId :: Maybe Text
location :: Maybe Text
$sel:fleetId:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
$sel:limit:DescribeGameSessions' :: DescribeGameSessions -> Maybe Natural
$sel:statusFilter:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
$sel:nextToken:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
$sel:aliasId:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
$sel:gameSessionId:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
$sel:location:DescribeGameSessions' :: DescribeGameSessions -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Location" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
location,
(Text
"GameSessionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
gameSessionId,
(Text
"AliasId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
aliasId,
(Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Text
"StatusFilter" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
statusFilter,
(Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
(Text
"FleetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
fleetId
]
)
instance Core.ToPath DescribeGameSessions where
toPath :: DescribeGameSessions -> ByteString
toPath = ByteString -> DescribeGameSessions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeGameSessions where
toQuery :: DescribeGameSessions -> QueryString
toQuery = QueryString -> DescribeGameSessions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeGameSessionsResponse = DescribeGameSessionsResponse'
{
DescribeGameSessionsResponse -> Maybe [GameSession]
gameSessions :: Prelude.Maybe [GameSession],
DescribeGameSessionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeGameSessionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeGameSessionsResponse
-> DescribeGameSessionsResponse -> Bool
(DescribeGameSessionsResponse
-> DescribeGameSessionsResponse -> Bool)
-> (DescribeGameSessionsResponse
-> DescribeGameSessionsResponse -> Bool)
-> Eq DescribeGameSessionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGameSessionsResponse
-> DescribeGameSessionsResponse -> Bool
$c/= :: DescribeGameSessionsResponse
-> DescribeGameSessionsResponse -> Bool
== :: DescribeGameSessionsResponse
-> DescribeGameSessionsResponse -> Bool
$c== :: DescribeGameSessionsResponse
-> DescribeGameSessionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeGameSessionsResponse]
ReadPrec DescribeGameSessionsResponse
Int -> ReadS DescribeGameSessionsResponse
ReadS [DescribeGameSessionsResponse]
(Int -> ReadS DescribeGameSessionsResponse)
-> ReadS [DescribeGameSessionsResponse]
-> ReadPrec DescribeGameSessionsResponse
-> ReadPrec [DescribeGameSessionsResponse]
-> Read DescribeGameSessionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGameSessionsResponse]
$creadListPrec :: ReadPrec [DescribeGameSessionsResponse]
readPrec :: ReadPrec DescribeGameSessionsResponse
$creadPrec :: ReadPrec DescribeGameSessionsResponse
readList :: ReadS [DescribeGameSessionsResponse]
$creadList :: ReadS [DescribeGameSessionsResponse]
readsPrec :: Int -> ReadS DescribeGameSessionsResponse
$creadsPrec :: Int -> ReadS DescribeGameSessionsResponse
Prelude.Read, Int -> DescribeGameSessionsResponse -> ShowS
[DescribeGameSessionsResponse] -> ShowS
DescribeGameSessionsResponse -> String
(Int -> DescribeGameSessionsResponse -> ShowS)
-> (DescribeGameSessionsResponse -> String)
-> ([DescribeGameSessionsResponse] -> ShowS)
-> Show DescribeGameSessionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGameSessionsResponse] -> ShowS
$cshowList :: [DescribeGameSessionsResponse] -> ShowS
show :: DescribeGameSessionsResponse -> String
$cshow :: DescribeGameSessionsResponse -> String
showsPrec :: Int -> DescribeGameSessionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeGameSessionsResponse -> ShowS
Prelude.Show, (forall x.
DescribeGameSessionsResponse -> Rep DescribeGameSessionsResponse x)
-> (forall x.
Rep DescribeGameSessionsResponse x -> DescribeGameSessionsResponse)
-> Generic DescribeGameSessionsResponse
forall x.
Rep DescribeGameSessionsResponse x -> DescribeGameSessionsResponse
forall x.
DescribeGameSessionsResponse -> Rep DescribeGameSessionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeGameSessionsResponse x -> DescribeGameSessionsResponse
$cfrom :: forall x.
DescribeGameSessionsResponse -> Rep DescribeGameSessionsResponse x
Prelude.Generic)
newDescribeGameSessionsResponse ::
Prelude.Int ->
DescribeGameSessionsResponse
newDescribeGameSessionsResponse :: Int -> DescribeGameSessionsResponse
newDescribeGameSessionsResponse Int
pHttpStatus_ =
DescribeGameSessionsResponse' :: Maybe [GameSession]
-> Maybe Text -> Int -> DescribeGameSessionsResponse
DescribeGameSessionsResponse'
{ $sel:gameSessions:DescribeGameSessionsResponse' :: Maybe [GameSession]
gameSessions =
Maybe [GameSession]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:DescribeGameSessionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeGameSessionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeGameSessionsResponse_gameSessions :: Lens.Lens' DescribeGameSessionsResponse (Prelude.Maybe [GameSession])
describeGameSessionsResponse_gameSessions :: (Maybe [GameSession] -> f (Maybe [GameSession]))
-> DescribeGameSessionsResponse -> f DescribeGameSessionsResponse
describeGameSessionsResponse_gameSessions = (DescribeGameSessionsResponse -> Maybe [GameSession])
-> (DescribeGameSessionsResponse
-> Maybe [GameSession] -> DescribeGameSessionsResponse)
-> Lens' DescribeGameSessionsResponse (Maybe [GameSession])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionsResponse' {Maybe [GameSession]
gameSessions :: Maybe [GameSession]
$sel:gameSessions:DescribeGameSessionsResponse' :: DescribeGameSessionsResponse -> Maybe [GameSession]
gameSessions} -> Maybe [GameSession]
gameSessions) (\s :: DescribeGameSessionsResponse
s@DescribeGameSessionsResponse' {} Maybe [GameSession]
a -> DescribeGameSessionsResponse
s {$sel:gameSessions:DescribeGameSessionsResponse' :: Maybe [GameSession]
gameSessions = Maybe [GameSession]
a} :: DescribeGameSessionsResponse) ((Maybe [GameSession] -> f (Maybe [GameSession]))
-> DescribeGameSessionsResponse -> f DescribeGameSessionsResponse)
-> ((Maybe [GameSession] -> f (Maybe [GameSession]))
-> Maybe [GameSession] -> f (Maybe [GameSession]))
-> (Maybe [GameSession] -> f (Maybe [GameSession]))
-> DescribeGameSessionsResponse
-> f DescribeGameSessionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [GameSession] [GameSession] [GameSession] [GameSession]
-> Iso
(Maybe [GameSession])
(Maybe [GameSession])
(Maybe [GameSession])
(Maybe [GameSession])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [GameSession] [GameSession] [GameSession] [GameSession]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeGameSessionsResponse_nextToken :: Lens.Lens' DescribeGameSessionsResponse (Prelude.Maybe Prelude.Text)
describeGameSessionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeGameSessionsResponse -> f DescribeGameSessionsResponse
describeGameSessionsResponse_nextToken = (DescribeGameSessionsResponse -> Maybe Text)
-> (DescribeGameSessionsResponse
-> Maybe Text -> DescribeGameSessionsResponse)
-> Lens' DescribeGameSessionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeGameSessionsResponse' :: DescribeGameSessionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeGameSessionsResponse
s@DescribeGameSessionsResponse' {} Maybe Text
a -> DescribeGameSessionsResponse
s {$sel:nextToken:DescribeGameSessionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeGameSessionsResponse)
describeGameSessionsResponse_httpStatus :: Lens.Lens' DescribeGameSessionsResponse Prelude.Int
describeGameSessionsResponse_httpStatus :: (Int -> f Int)
-> DescribeGameSessionsResponse -> f DescribeGameSessionsResponse
describeGameSessionsResponse_httpStatus = (DescribeGameSessionsResponse -> Int)
-> (DescribeGameSessionsResponse
-> Int -> DescribeGameSessionsResponse)
-> Lens
DescribeGameSessionsResponse DescribeGameSessionsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeGameSessionsResponse' :: DescribeGameSessionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeGameSessionsResponse
s@DescribeGameSessionsResponse' {} Int
a -> DescribeGameSessionsResponse
s {$sel:httpStatus:DescribeGameSessionsResponse' :: Int
httpStatus = Int
a} :: DescribeGameSessionsResponse)
instance Prelude.NFData DescribeGameSessionsResponse