{-# 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.SearchGameSessions
(
SearchGameSessions (..),
newSearchGameSessions,
searchGameSessions_filterExpression,
searchGameSessions_location,
searchGameSessions_sortExpression,
searchGameSessions_aliasId,
searchGameSessions_nextToken,
searchGameSessions_limit,
searchGameSessions_fleetId,
SearchGameSessionsResponse (..),
newSearchGameSessionsResponse,
searchGameSessionsResponse_gameSessions,
searchGameSessionsResponse_nextToken,
searchGameSessionsResponse_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 SearchGameSessions = SearchGameSessions'
{
SearchGameSessions -> Maybe Text
filterExpression :: Prelude.Maybe Prelude.Text,
SearchGameSessions -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
SearchGameSessions -> Maybe Text
sortExpression :: Prelude.Maybe Prelude.Text,
SearchGameSessions -> Maybe Text
aliasId :: Prelude.Maybe Prelude.Text,
SearchGameSessions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
SearchGameSessions -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
SearchGameSessions -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text
}
deriving (SearchGameSessions -> SearchGameSessions -> Bool
(SearchGameSessions -> SearchGameSessions -> Bool)
-> (SearchGameSessions -> SearchGameSessions -> Bool)
-> Eq SearchGameSessions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchGameSessions -> SearchGameSessions -> Bool
$c/= :: SearchGameSessions -> SearchGameSessions -> Bool
== :: SearchGameSessions -> SearchGameSessions -> Bool
$c== :: SearchGameSessions -> SearchGameSessions -> Bool
Prelude.Eq, ReadPrec [SearchGameSessions]
ReadPrec SearchGameSessions
Int -> ReadS SearchGameSessions
ReadS [SearchGameSessions]
(Int -> ReadS SearchGameSessions)
-> ReadS [SearchGameSessions]
-> ReadPrec SearchGameSessions
-> ReadPrec [SearchGameSessions]
-> Read SearchGameSessions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchGameSessions]
$creadListPrec :: ReadPrec [SearchGameSessions]
readPrec :: ReadPrec SearchGameSessions
$creadPrec :: ReadPrec SearchGameSessions
readList :: ReadS [SearchGameSessions]
$creadList :: ReadS [SearchGameSessions]
readsPrec :: Int -> ReadS SearchGameSessions
$creadsPrec :: Int -> ReadS SearchGameSessions
Prelude.Read, Int -> SearchGameSessions -> ShowS
[SearchGameSessions] -> ShowS
SearchGameSessions -> String
(Int -> SearchGameSessions -> ShowS)
-> (SearchGameSessions -> String)
-> ([SearchGameSessions] -> ShowS)
-> Show SearchGameSessions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchGameSessions] -> ShowS
$cshowList :: [SearchGameSessions] -> ShowS
show :: SearchGameSessions -> String
$cshow :: SearchGameSessions -> String
showsPrec :: Int -> SearchGameSessions -> ShowS
$cshowsPrec :: Int -> SearchGameSessions -> ShowS
Prelude.Show, (forall x. SearchGameSessions -> Rep SearchGameSessions x)
-> (forall x. Rep SearchGameSessions x -> SearchGameSessions)
-> Generic SearchGameSessions
forall x. Rep SearchGameSessions x -> SearchGameSessions
forall x. SearchGameSessions -> Rep SearchGameSessions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchGameSessions x -> SearchGameSessions
$cfrom :: forall x. SearchGameSessions -> Rep SearchGameSessions x
Prelude.Generic)
newSearchGameSessions ::
SearchGameSessions
newSearchGameSessions :: SearchGameSessions
newSearchGameSessions =
SearchGameSessions' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> SearchGameSessions
SearchGameSessions'
{ $sel:filterExpression:SearchGameSessions' :: Maybe Text
filterExpression =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:location:SearchGameSessions' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sortExpression:SearchGameSessions' :: Maybe Text
sortExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:aliasId:SearchGameSessions' :: Maybe Text
aliasId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:SearchGameSessions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:limit:SearchGameSessions' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:SearchGameSessions' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
searchGameSessions_filterExpression :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Text)
searchGameSessions_filterExpression :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_filterExpression = (SearchGameSessions -> Maybe Text)
-> (SearchGameSessions -> Maybe Text -> SearchGameSessions)
-> Lens
SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Text
filterExpression :: Maybe Text
$sel:filterExpression:SearchGameSessions' :: SearchGameSessions -> Maybe Text
filterExpression} -> Maybe Text
filterExpression) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Text
a -> SearchGameSessions
s {$sel:filterExpression:SearchGameSessions' :: Maybe Text
filterExpression = Maybe Text
a} :: SearchGameSessions)
searchGameSessions_location :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Text)
searchGameSessions_location :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_location = (SearchGameSessions -> Maybe Text)
-> (SearchGameSessions -> Maybe Text -> SearchGameSessions)
-> Lens
SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Text
location :: Maybe Text
$sel:location:SearchGameSessions' :: SearchGameSessions -> Maybe Text
location} -> Maybe Text
location) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Text
a -> SearchGameSessions
s {$sel:location:SearchGameSessions' :: Maybe Text
location = Maybe Text
a} :: SearchGameSessions)
searchGameSessions_sortExpression :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Text)
searchGameSessions_sortExpression :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_sortExpression = (SearchGameSessions -> Maybe Text)
-> (SearchGameSessions -> Maybe Text -> SearchGameSessions)
-> Lens
SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Text
sortExpression :: Maybe Text
$sel:sortExpression:SearchGameSessions' :: SearchGameSessions -> Maybe Text
sortExpression} -> Maybe Text
sortExpression) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Text
a -> SearchGameSessions
s {$sel:sortExpression:SearchGameSessions' :: Maybe Text
sortExpression = Maybe Text
a} :: SearchGameSessions)
searchGameSessions_aliasId :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Text)
searchGameSessions_aliasId :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_aliasId = (SearchGameSessions -> Maybe Text)
-> (SearchGameSessions -> Maybe Text -> SearchGameSessions)
-> Lens
SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Text
aliasId :: Maybe Text
$sel:aliasId:SearchGameSessions' :: SearchGameSessions -> Maybe Text
aliasId} -> Maybe Text
aliasId) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Text
a -> SearchGameSessions
s {$sel:aliasId:SearchGameSessions' :: Maybe Text
aliasId = Maybe Text
a} :: SearchGameSessions)
searchGameSessions_nextToken :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Text)
searchGameSessions_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_nextToken = (SearchGameSessions -> Maybe Text)
-> (SearchGameSessions -> Maybe Text -> SearchGameSessions)
-> Lens
SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchGameSessions' :: SearchGameSessions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Text
a -> SearchGameSessions
s {$sel:nextToken:SearchGameSessions' :: Maybe Text
nextToken = Maybe Text
a} :: SearchGameSessions)
searchGameSessions_limit :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Natural)
searchGameSessions_limit :: (Maybe Natural -> f (Maybe Natural))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_limit = (SearchGameSessions -> Maybe Natural)
-> (SearchGameSessions -> Maybe Natural -> SearchGameSessions)
-> Lens
SearchGameSessions
SearchGameSessions
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Natural
limit :: Maybe Natural
$sel:limit:SearchGameSessions' :: SearchGameSessions -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Natural
a -> SearchGameSessions
s {$sel:limit:SearchGameSessions' :: Maybe Natural
limit = Maybe Natural
a} :: SearchGameSessions)
searchGameSessions_fleetId :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Text)
searchGameSessions_fleetId :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_fleetId = (SearchGameSessions -> Maybe Text)
-> (SearchGameSessions -> Maybe Text -> SearchGameSessions)
-> Lens
SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:SearchGameSessions' :: SearchGameSessions -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Text
a -> SearchGameSessions
s {$sel:fleetId:SearchGameSessions' :: Maybe Text
fleetId = Maybe Text
a} :: SearchGameSessions)
instance Core.AWSPager SearchGameSessions where
page :: SearchGameSessions
-> AWSResponse SearchGameSessions -> Maybe SearchGameSessions
page SearchGameSessions
rq AWSResponse SearchGameSessions
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse SearchGameSessions
SearchGameSessionsResponse
rs
SearchGameSessionsResponse
-> Getting (First Text) SearchGameSessionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> SearchGameSessionsResponse
-> Const (First Text) SearchGameSessionsResponse
Lens' SearchGameSessionsResponse (Maybe Text)
searchGameSessionsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> SearchGameSessionsResponse
-> Const (First Text) SearchGameSessionsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) SearchGameSessionsResponse 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 SearchGameSessions
forall a. Maybe a
Prelude.Nothing
| Maybe [GameSession] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse SearchGameSessions
SearchGameSessionsResponse
rs
SearchGameSessionsResponse
-> Getting
(First [GameSession]) SearchGameSessionsResponse [GameSession]
-> Maybe [GameSession]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [GameSession]
-> Const (First [GameSession]) (Maybe [GameSession]))
-> SearchGameSessionsResponse
-> Const (First [GameSession]) SearchGameSessionsResponse
Lens' SearchGameSessionsResponse (Maybe [GameSession])
searchGameSessionsResponse_gameSessions
((Maybe [GameSession]
-> Const (First [GameSession]) (Maybe [GameSession]))
-> SearchGameSessionsResponse
-> Const (First [GameSession]) SearchGameSessionsResponse)
-> (([GameSession] -> Const (First [GameSession]) [GameSession])
-> Maybe [GameSession]
-> Const (First [GameSession]) (Maybe [GameSession]))
-> Getting
(First [GameSession]) SearchGameSessionsResponse [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 SearchGameSessions
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
SearchGameSessions -> Maybe SearchGameSessions
forall a. a -> Maybe a
Prelude.Just (SearchGameSessions -> Maybe SearchGameSessions)
-> SearchGameSessions -> Maybe SearchGameSessions
forall a b. (a -> b) -> a -> b
Prelude.$
SearchGameSessions
rq
SearchGameSessions
-> (SearchGameSessions -> SearchGameSessions) -> SearchGameSessions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> SearchGameSessions -> Identity SearchGameSessions
Lens
SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
searchGameSessions_nextToken
((Maybe Text -> Identity (Maybe Text))
-> SearchGameSessions -> Identity SearchGameSessions)
-> Maybe Text -> SearchGameSessions -> SearchGameSessions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse SearchGameSessions
SearchGameSessionsResponse
rs
SearchGameSessionsResponse
-> Getting (First Text) SearchGameSessionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> SearchGameSessionsResponse
-> Const (First Text) SearchGameSessionsResponse
Lens' SearchGameSessionsResponse (Maybe Text)
searchGameSessionsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> SearchGameSessionsResponse
-> Const (First Text) SearchGameSessionsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) SearchGameSessionsResponse 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 SearchGameSessions where
type
AWSResponse SearchGameSessions =
SearchGameSessionsResponse
request :: SearchGameSessions -> Request SearchGameSessions
request = Service -> SearchGameSessions -> Request SearchGameSessions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SearchGameSessions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SearchGameSessions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse SearchGameSessions))
-> Logger
-> Service
-> Proxy SearchGameSessions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SearchGameSessions)))
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 -> SearchGameSessionsResponse
SearchGameSessionsResponse'
(Maybe [GameSession]
-> Maybe Text -> Int -> SearchGameSessionsResponse)
-> Either String (Maybe [GameSession])
-> Either String (Maybe Text -> Int -> SearchGameSessionsResponse)
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 -> SearchGameSessionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> SearchGameSessionsResponse)
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 -> SearchGameSessionsResponse)
-> Either String Int -> Either String SearchGameSessionsResponse
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 SearchGameSessions
instance Prelude.NFData SearchGameSessions
instance Core.ToHeaders SearchGameSessions where
toHeaders :: SearchGameSessions -> ResponseHeaders
toHeaders =
ResponseHeaders -> SearchGameSessions -> 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.SearchGameSessions" ::
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 SearchGameSessions where
toJSON :: SearchGameSessions -> Value
toJSON SearchGameSessions' {Maybe Natural
Maybe Text
fleetId :: Maybe Text
limit :: Maybe Natural
nextToken :: Maybe Text
aliasId :: Maybe Text
sortExpression :: Maybe Text
location :: Maybe Text
filterExpression :: Maybe Text
$sel:fleetId:SearchGameSessions' :: SearchGameSessions -> Maybe Text
$sel:limit:SearchGameSessions' :: SearchGameSessions -> Maybe Natural
$sel:nextToken:SearchGameSessions' :: SearchGameSessions -> Maybe Text
$sel:aliasId:SearchGameSessions' :: SearchGameSessions -> Maybe Text
$sel:sortExpression:SearchGameSessions' :: SearchGameSessions -> Maybe Text
$sel:location:SearchGameSessions' :: SearchGameSessions -> Maybe Text
$sel:filterExpression:SearchGameSessions' :: SearchGameSessions -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"FilterExpression" 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
filterExpression,
(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
"SortExpression" 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
sortExpression,
(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
"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 SearchGameSessions where
toPath :: SearchGameSessions -> ByteString
toPath = ByteString -> SearchGameSessions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SearchGameSessions where
toQuery :: SearchGameSessions -> QueryString
toQuery = QueryString -> SearchGameSessions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SearchGameSessionsResponse = SearchGameSessionsResponse'
{
SearchGameSessionsResponse -> Maybe [GameSession]
gameSessions :: Prelude.Maybe [GameSession],
SearchGameSessionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
SearchGameSessionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SearchGameSessionsResponse -> SearchGameSessionsResponse -> Bool
(SearchGameSessionsResponse -> SearchGameSessionsResponse -> Bool)
-> (SearchGameSessionsResponse
-> SearchGameSessionsResponse -> Bool)
-> Eq SearchGameSessionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchGameSessionsResponse -> SearchGameSessionsResponse -> Bool
$c/= :: SearchGameSessionsResponse -> SearchGameSessionsResponse -> Bool
== :: SearchGameSessionsResponse -> SearchGameSessionsResponse -> Bool
$c== :: SearchGameSessionsResponse -> SearchGameSessionsResponse -> Bool
Prelude.Eq, ReadPrec [SearchGameSessionsResponse]
ReadPrec SearchGameSessionsResponse
Int -> ReadS SearchGameSessionsResponse
ReadS [SearchGameSessionsResponse]
(Int -> ReadS SearchGameSessionsResponse)
-> ReadS [SearchGameSessionsResponse]
-> ReadPrec SearchGameSessionsResponse
-> ReadPrec [SearchGameSessionsResponse]
-> Read SearchGameSessionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchGameSessionsResponse]
$creadListPrec :: ReadPrec [SearchGameSessionsResponse]
readPrec :: ReadPrec SearchGameSessionsResponse
$creadPrec :: ReadPrec SearchGameSessionsResponse
readList :: ReadS [SearchGameSessionsResponse]
$creadList :: ReadS [SearchGameSessionsResponse]
readsPrec :: Int -> ReadS SearchGameSessionsResponse
$creadsPrec :: Int -> ReadS SearchGameSessionsResponse
Prelude.Read, Int -> SearchGameSessionsResponse -> ShowS
[SearchGameSessionsResponse] -> ShowS
SearchGameSessionsResponse -> String
(Int -> SearchGameSessionsResponse -> ShowS)
-> (SearchGameSessionsResponse -> String)
-> ([SearchGameSessionsResponse] -> ShowS)
-> Show SearchGameSessionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchGameSessionsResponse] -> ShowS
$cshowList :: [SearchGameSessionsResponse] -> ShowS
show :: SearchGameSessionsResponse -> String
$cshow :: SearchGameSessionsResponse -> String
showsPrec :: Int -> SearchGameSessionsResponse -> ShowS
$cshowsPrec :: Int -> SearchGameSessionsResponse -> ShowS
Prelude.Show, (forall x.
SearchGameSessionsResponse -> Rep SearchGameSessionsResponse x)
-> (forall x.
Rep SearchGameSessionsResponse x -> SearchGameSessionsResponse)
-> Generic SearchGameSessionsResponse
forall x.
Rep SearchGameSessionsResponse x -> SearchGameSessionsResponse
forall x.
SearchGameSessionsResponse -> Rep SearchGameSessionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchGameSessionsResponse x -> SearchGameSessionsResponse
$cfrom :: forall x.
SearchGameSessionsResponse -> Rep SearchGameSessionsResponse x
Prelude.Generic)
newSearchGameSessionsResponse ::
Prelude.Int ->
SearchGameSessionsResponse
newSearchGameSessionsResponse :: Int -> SearchGameSessionsResponse
newSearchGameSessionsResponse Int
pHttpStatus_ =
SearchGameSessionsResponse' :: Maybe [GameSession]
-> Maybe Text -> Int -> SearchGameSessionsResponse
SearchGameSessionsResponse'
{ $sel:gameSessions:SearchGameSessionsResponse' :: Maybe [GameSession]
gameSessions =
Maybe [GameSession]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:SearchGameSessionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SearchGameSessionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
searchGameSessionsResponse_gameSessions :: Lens.Lens' SearchGameSessionsResponse (Prelude.Maybe [GameSession])
searchGameSessionsResponse_gameSessions :: (Maybe [GameSession] -> f (Maybe [GameSession]))
-> SearchGameSessionsResponse -> f SearchGameSessionsResponse
searchGameSessionsResponse_gameSessions = (SearchGameSessionsResponse -> Maybe [GameSession])
-> (SearchGameSessionsResponse
-> Maybe [GameSession] -> SearchGameSessionsResponse)
-> Lens' SearchGameSessionsResponse (Maybe [GameSession])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessionsResponse' {Maybe [GameSession]
gameSessions :: Maybe [GameSession]
$sel:gameSessions:SearchGameSessionsResponse' :: SearchGameSessionsResponse -> Maybe [GameSession]
gameSessions} -> Maybe [GameSession]
gameSessions) (\s :: SearchGameSessionsResponse
s@SearchGameSessionsResponse' {} Maybe [GameSession]
a -> SearchGameSessionsResponse
s {$sel:gameSessions:SearchGameSessionsResponse' :: Maybe [GameSession]
gameSessions = Maybe [GameSession]
a} :: SearchGameSessionsResponse) ((Maybe [GameSession] -> f (Maybe [GameSession]))
-> SearchGameSessionsResponse -> f SearchGameSessionsResponse)
-> ((Maybe [GameSession] -> f (Maybe [GameSession]))
-> Maybe [GameSession] -> f (Maybe [GameSession]))
-> (Maybe [GameSession] -> f (Maybe [GameSession]))
-> SearchGameSessionsResponse
-> f SearchGameSessionsResponse
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
searchGameSessionsResponse_nextToken :: Lens.Lens' SearchGameSessionsResponse (Prelude.Maybe Prelude.Text)
searchGameSessionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessionsResponse -> f SearchGameSessionsResponse
searchGameSessionsResponse_nextToken = (SearchGameSessionsResponse -> Maybe Text)
-> (SearchGameSessionsResponse
-> Maybe Text -> SearchGameSessionsResponse)
-> Lens' SearchGameSessionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchGameSessionsResponse' :: SearchGameSessionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchGameSessionsResponse
s@SearchGameSessionsResponse' {} Maybe Text
a -> SearchGameSessionsResponse
s {$sel:nextToken:SearchGameSessionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchGameSessionsResponse)
searchGameSessionsResponse_httpStatus :: Lens.Lens' SearchGameSessionsResponse Prelude.Int
searchGameSessionsResponse_httpStatus :: (Int -> f Int)
-> SearchGameSessionsResponse -> f SearchGameSessionsResponse
searchGameSessionsResponse_httpStatus = (SearchGameSessionsResponse -> Int)
-> (SearchGameSessionsResponse
-> Int -> SearchGameSessionsResponse)
-> Lens
SearchGameSessionsResponse SearchGameSessionsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:SearchGameSessionsResponse' :: SearchGameSessionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SearchGameSessionsResponse
s@SearchGameSessionsResponse' {} Int
a -> SearchGameSessionsResponse
s {$sel:httpStatus:SearchGameSessionsResponse' :: Int
httpStatus = Int
a} :: SearchGameSessionsResponse)
instance Prelude.NFData SearchGameSessionsResponse