{-# 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.DescribeMatchmaking
(
DescribeMatchmaking (..),
newDescribeMatchmaking,
describeMatchmaking_ticketIds,
DescribeMatchmakingResponse (..),
newDescribeMatchmakingResponse,
describeMatchmakingResponse_ticketList,
describeMatchmakingResponse_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 DescribeMatchmaking = DescribeMatchmaking'
{
DescribeMatchmaking -> [Text]
ticketIds :: [Prelude.Text]
}
deriving (DescribeMatchmaking -> DescribeMatchmaking -> Bool
(DescribeMatchmaking -> DescribeMatchmaking -> Bool)
-> (DescribeMatchmaking -> DescribeMatchmaking -> Bool)
-> Eq DescribeMatchmaking
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeMatchmaking -> DescribeMatchmaking -> Bool
$c/= :: DescribeMatchmaking -> DescribeMatchmaking -> Bool
== :: DescribeMatchmaking -> DescribeMatchmaking -> Bool
$c== :: DescribeMatchmaking -> DescribeMatchmaking -> Bool
Prelude.Eq, ReadPrec [DescribeMatchmaking]
ReadPrec DescribeMatchmaking
Int -> ReadS DescribeMatchmaking
ReadS [DescribeMatchmaking]
(Int -> ReadS DescribeMatchmaking)
-> ReadS [DescribeMatchmaking]
-> ReadPrec DescribeMatchmaking
-> ReadPrec [DescribeMatchmaking]
-> Read DescribeMatchmaking
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeMatchmaking]
$creadListPrec :: ReadPrec [DescribeMatchmaking]
readPrec :: ReadPrec DescribeMatchmaking
$creadPrec :: ReadPrec DescribeMatchmaking
readList :: ReadS [DescribeMatchmaking]
$creadList :: ReadS [DescribeMatchmaking]
readsPrec :: Int -> ReadS DescribeMatchmaking
$creadsPrec :: Int -> ReadS DescribeMatchmaking
Prelude.Read, Int -> DescribeMatchmaking -> ShowS
[DescribeMatchmaking] -> ShowS
DescribeMatchmaking -> String
(Int -> DescribeMatchmaking -> ShowS)
-> (DescribeMatchmaking -> String)
-> ([DescribeMatchmaking] -> ShowS)
-> Show DescribeMatchmaking
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeMatchmaking] -> ShowS
$cshowList :: [DescribeMatchmaking] -> ShowS
show :: DescribeMatchmaking -> String
$cshow :: DescribeMatchmaking -> String
showsPrec :: Int -> DescribeMatchmaking -> ShowS
$cshowsPrec :: Int -> DescribeMatchmaking -> ShowS
Prelude.Show, (forall x. DescribeMatchmaking -> Rep DescribeMatchmaking x)
-> (forall x. Rep DescribeMatchmaking x -> DescribeMatchmaking)
-> Generic DescribeMatchmaking
forall x. Rep DescribeMatchmaking x -> DescribeMatchmaking
forall x. DescribeMatchmaking -> Rep DescribeMatchmaking x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeMatchmaking x -> DescribeMatchmaking
$cfrom :: forall x. DescribeMatchmaking -> Rep DescribeMatchmaking x
Prelude.Generic)
newDescribeMatchmaking ::
DescribeMatchmaking
newDescribeMatchmaking :: DescribeMatchmaking
newDescribeMatchmaking =
DescribeMatchmaking' :: [Text] -> DescribeMatchmaking
DescribeMatchmaking' {$sel:ticketIds:DescribeMatchmaking' :: [Text]
ticketIds = [Text]
forall a. Monoid a => a
Prelude.mempty}
describeMatchmaking_ticketIds :: Lens.Lens' DescribeMatchmaking [Prelude.Text]
describeMatchmaking_ticketIds :: ([Text] -> f [Text])
-> DescribeMatchmaking -> f DescribeMatchmaking
describeMatchmaking_ticketIds = (DescribeMatchmaking -> [Text])
-> (DescribeMatchmaking -> [Text] -> DescribeMatchmaking)
-> Lens DescribeMatchmaking DescribeMatchmaking [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMatchmaking' {[Text]
ticketIds :: [Text]
$sel:ticketIds:DescribeMatchmaking' :: DescribeMatchmaking -> [Text]
ticketIds} -> [Text]
ticketIds) (\s :: DescribeMatchmaking
s@DescribeMatchmaking' {} [Text]
a -> DescribeMatchmaking
s {$sel:ticketIds:DescribeMatchmaking' :: [Text]
ticketIds = [Text]
a} :: DescribeMatchmaking) (([Text] -> f [Text])
-> DescribeMatchmaking -> f DescribeMatchmaking)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DescribeMatchmaking
-> f DescribeMatchmaking
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DescribeMatchmaking where
type
AWSResponse DescribeMatchmaking =
DescribeMatchmakingResponse
request :: DescribeMatchmaking -> Request DescribeMatchmaking
request = Service -> DescribeMatchmaking -> Request DescribeMatchmaking
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeMatchmaking
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeMatchmaking)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeMatchmaking))
-> Logger
-> Service
-> Proxy DescribeMatchmaking
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeMatchmaking)))
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 [MatchmakingTicket] -> Int -> DescribeMatchmakingResponse
DescribeMatchmakingResponse'
(Maybe [MatchmakingTicket] -> Int -> DescribeMatchmakingResponse)
-> Either String (Maybe [MatchmakingTicket])
-> Either String (Int -> DescribeMatchmakingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [MatchmakingTicket]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TicketList" Either String (Maybe (Maybe [MatchmakingTicket]))
-> Maybe [MatchmakingTicket]
-> Either String (Maybe [MatchmakingTicket])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MatchmakingTicket]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> DescribeMatchmakingResponse)
-> Either String Int -> Either String DescribeMatchmakingResponse
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 DescribeMatchmaking
instance Prelude.NFData DescribeMatchmaking
instance Core.ToHeaders DescribeMatchmaking where
toHeaders :: DescribeMatchmaking -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeMatchmaking -> 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.DescribeMatchmaking" ::
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 DescribeMatchmaking where
toJSON :: DescribeMatchmaking -> Value
toJSON DescribeMatchmaking' {[Text]
ticketIds :: [Text]
$sel:ticketIds:DescribeMatchmaking' :: DescribeMatchmaking -> [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
"TicketIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
ticketIds)]
)
instance Core.ToPath DescribeMatchmaking where
toPath :: DescribeMatchmaking -> ByteString
toPath = ByteString -> DescribeMatchmaking -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeMatchmaking where
toQuery :: DescribeMatchmaking -> QueryString
toQuery = QueryString -> DescribeMatchmaking -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeMatchmakingResponse = DescribeMatchmakingResponse'
{
DescribeMatchmakingResponse -> Maybe [MatchmakingTicket]
ticketList :: Prelude.Maybe [MatchmakingTicket],
DescribeMatchmakingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeMatchmakingResponse -> DescribeMatchmakingResponse -> Bool
(DescribeMatchmakingResponse
-> DescribeMatchmakingResponse -> Bool)
-> (DescribeMatchmakingResponse
-> DescribeMatchmakingResponse -> Bool)
-> Eq DescribeMatchmakingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeMatchmakingResponse -> DescribeMatchmakingResponse -> Bool
$c/= :: DescribeMatchmakingResponse -> DescribeMatchmakingResponse -> Bool
== :: DescribeMatchmakingResponse -> DescribeMatchmakingResponse -> Bool
$c== :: DescribeMatchmakingResponse -> DescribeMatchmakingResponse -> Bool
Prelude.Eq, ReadPrec [DescribeMatchmakingResponse]
ReadPrec DescribeMatchmakingResponse
Int -> ReadS DescribeMatchmakingResponse
ReadS [DescribeMatchmakingResponse]
(Int -> ReadS DescribeMatchmakingResponse)
-> ReadS [DescribeMatchmakingResponse]
-> ReadPrec DescribeMatchmakingResponse
-> ReadPrec [DescribeMatchmakingResponse]
-> Read DescribeMatchmakingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeMatchmakingResponse]
$creadListPrec :: ReadPrec [DescribeMatchmakingResponse]
readPrec :: ReadPrec DescribeMatchmakingResponse
$creadPrec :: ReadPrec DescribeMatchmakingResponse
readList :: ReadS [DescribeMatchmakingResponse]
$creadList :: ReadS [DescribeMatchmakingResponse]
readsPrec :: Int -> ReadS DescribeMatchmakingResponse
$creadsPrec :: Int -> ReadS DescribeMatchmakingResponse
Prelude.Read, Int -> DescribeMatchmakingResponse -> ShowS
[DescribeMatchmakingResponse] -> ShowS
DescribeMatchmakingResponse -> String
(Int -> DescribeMatchmakingResponse -> ShowS)
-> (DescribeMatchmakingResponse -> String)
-> ([DescribeMatchmakingResponse] -> ShowS)
-> Show DescribeMatchmakingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeMatchmakingResponse] -> ShowS
$cshowList :: [DescribeMatchmakingResponse] -> ShowS
show :: DescribeMatchmakingResponse -> String
$cshow :: DescribeMatchmakingResponse -> String
showsPrec :: Int -> DescribeMatchmakingResponse -> ShowS
$cshowsPrec :: Int -> DescribeMatchmakingResponse -> ShowS
Prelude.Show, (forall x.
DescribeMatchmakingResponse -> Rep DescribeMatchmakingResponse x)
-> (forall x.
Rep DescribeMatchmakingResponse x -> DescribeMatchmakingResponse)
-> Generic DescribeMatchmakingResponse
forall x.
Rep DescribeMatchmakingResponse x -> DescribeMatchmakingResponse
forall x.
DescribeMatchmakingResponse -> Rep DescribeMatchmakingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeMatchmakingResponse x -> DescribeMatchmakingResponse
$cfrom :: forall x.
DescribeMatchmakingResponse -> Rep DescribeMatchmakingResponse x
Prelude.Generic)
newDescribeMatchmakingResponse ::
Prelude.Int ->
DescribeMatchmakingResponse
newDescribeMatchmakingResponse :: Int -> DescribeMatchmakingResponse
newDescribeMatchmakingResponse Int
pHttpStatus_ =
DescribeMatchmakingResponse' :: Maybe [MatchmakingTicket] -> Int -> DescribeMatchmakingResponse
DescribeMatchmakingResponse'
{ $sel:ticketList:DescribeMatchmakingResponse' :: Maybe [MatchmakingTicket]
ticketList =
Maybe [MatchmakingTicket]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeMatchmakingResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeMatchmakingResponse_ticketList :: Lens.Lens' DescribeMatchmakingResponse (Prelude.Maybe [MatchmakingTicket])
describeMatchmakingResponse_ticketList :: (Maybe [MatchmakingTicket] -> f (Maybe [MatchmakingTicket]))
-> DescribeMatchmakingResponse -> f DescribeMatchmakingResponse
describeMatchmakingResponse_ticketList = (DescribeMatchmakingResponse -> Maybe [MatchmakingTicket])
-> (DescribeMatchmakingResponse
-> Maybe [MatchmakingTicket] -> DescribeMatchmakingResponse)
-> Lens
DescribeMatchmakingResponse
DescribeMatchmakingResponse
(Maybe [MatchmakingTicket])
(Maybe [MatchmakingTicket])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMatchmakingResponse' {Maybe [MatchmakingTicket]
ticketList :: Maybe [MatchmakingTicket]
$sel:ticketList:DescribeMatchmakingResponse' :: DescribeMatchmakingResponse -> Maybe [MatchmakingTicket]
ticketList} -> Maybe [MatchmakingTicket]
ticketList) (\s :: DescribeMatchmakingResponse
s@DescribeMatchmakingResponse' {} Maybe [MatchmakingTicket]
a -> DescribeMatchmakingResponse
s {$sel:ticketList:DescribeMatchmakingResponse' :: Maybe [MatchmakingTicket]
ticketList = Maybe [MatchmakingTicket]
a} :: DescribeMatchmakingResponse) ((Maybe [MatchmakingTicket] -> f (Maybe [MatchmakingTicket]))
-> DescribeMatchmakingResponse -> f DescribeMatchmakingResponse)
-> ((Maybe [MatchmakingTicket] -> f (Maybe [MatchmakingTicket]))
-> Maybe [MatchmakingTicket] -> f (Maybe [MatchmakingTicket]))
-> (Maybe [MatchmakingTicket] -> f (Maybe [MatchmakingTicket]))
-> DescribeMatchmakingResponse
-> f DescribeMatchmakingResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[MatchmakingTicket]
[MatchmakingTicket]
[MatchmakingTicket]
[MatchmakingTicket]
-> Iso
(Maybe [MatchmakingTicket])
(Maybe [MatchmakingTicket])
(Maybe [MatchmakingTicket])
(Maybe [MatchmakingTicket])
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
[MatchmakingTicket]
[MatchmakingTicket]
[MatchmakingTicket]
[MatchmakingTicket]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeMatchmakingResponse_httpStatus :: Lens.Lens' DescribeMatchmakingResponse Prelude.Int
describeMatchmakingResponse_httpStatus :: (Int -> f Int)
-> DescribeMatchmakingResponse -> f DescribeMatchmakingResponse
describeMatchmakingResponse_httpStatus = (DescribeMatchmakingResponse -> Int)
-> (DescribeMatchmakingResponse
-> Int -> DescribeMatchmakingResponse)
-> Lens
DescribeMatchmakingResponse DescribeMatchmakingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMatchmakingResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeMatchmakingResponse' :: DescribeMatchmakingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeMatchmakingResponse
s@DescribeMatchmakingResponse' {} Int
a -> DescribeMatchmakingResponse
s {$sel:httpStatus:DescribeMatchmakingResponse' :: Int
httpStatus = Int
a} :: DescribeMatchmakingResponse)
instance Prelude.NFData DescribeMatchmakingResponse