{-# 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.StopMatchmaking
(
StopMatchmaking (..),
newStopMatchmaking,
stopMatchmaking_ticketId,
StopMatchmakingResponse (..),
newStopMatchmakingResponse,
stopMatchmakingResponse_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 StopMatchmaking = StopMatchmaking'
{
StopMatchmaking -> Text
ticketId :: Prelude.Text
}
deriving (StopMatchmaking -> StopMatchmaking -> Bool
(StopMatchmaking -> StopMatchmaking -> Bool)
-> (StopMatchmaking -> StopMatchmaking -> Bool)
-> Eq StopMatchmaking
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopMatchmaking -> StopMatchmaking -> Bool
$c/= :: StopMatchmaking -> StopMatchmaking -> Bool
== :: StopMatchmaking -> StopMatchmaking -> Bool
$c== :: StopMatchmaking -> StopMatchmaking -> Bool
Prelude.Eq, ReadPrec [StopMatchmaking]
ReadPrec StopMatchmaking
Int -> ReadS StopMatchmaking
ReadS [StopMatchmaking]
(Int -> ReadS StopMatchmaking)
-> ReadS [StopMatchmaking]
-> ReadPrec StopMatchmaking
-> ReadPrec [StopMatchmaking]
-> Read StopMatchmaking
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopMatchmaking]
$creadListPrec :: ReadPrec [StopMatchmaking]
readPrec :: ReadPrec StopMatchmaking
$creadPrec :: ReadPrec StopMatchmaking
readList :: ReadS [StopMatchmaking]
$creadList :: ReadS [StopMatchmaking]
readsPrec :: Int -> ReadS StopMatchmaking
$creadsPrec :: Int -> ReadS StopMatchmaking
Prelude.Read, Int -> StopMatchmaking -> ShowS
[StopMatchmaking] -> ShowS
StopMatchmaking -> String
(Int -> StopMatchmaking -> ShowS)
-> (StopMatchmaking -> String)
-> ([StopMatchmaking] -> ShowS)
-> Show StopMatchmaking
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopMatchmaking] -> ShowS
$cshowList :: [StopMatchmaking] -> ShowS
show :: StopMatchmaking -> String
$cshow :: StopMatchmaking -> String
showsPrec :: Int -> StopMatchmaking -> ShowS
$cshowsPrec :: Int -> StopMatchmaking -> ShowS
Prelude.Show, (forall x. StopMatchmaking -> Rep StopMatchmaking x)
-> (forall x. Rep StopMatchmaking x -> StopMatchmaking)
-> Generic StopMatchmaking
forall x. Rep StopMatchmaking x -> StopMatchmaking
forall x. StopMatchmaking -> Rep StopMatchmaking x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopMatchmaking x -> StopMatchmaking
$cfrom :: forall x. StopMatchmaking -> Rep StopMatchmaking x
Prelude.Generic)
newStopMatchmaking ::
Prelude.Text ->
StopMatchmaking
newStopMatchmaking :: Text -> StopMatchmaking
newStopMatchmaking Text
pTicketId_ =
StopMatchmaking' :: Text -> StopMatchmaking
StopMatchmaking' {$sel:ticketId:StopMatchmaking' :: Text
ticketId = Text
pTicketId_}
stopMatchmaking_ticketId :: Lens.Lens' StopMatchmaking Prelude.Text
stopMatchmaking_ticketId :: (Text -> f Text) -> StopMatchmaking -> f StopMatchmaking
stopMatchmaking_ticketId = (StopMatchmaking -> Text)
-> (StopMatchmaking -> Text -> StopMatchmaking)
-> Lens StopMatchmaking StopMatchmaking Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopMatchmaking' {Text
ticketId :: Text
$sel:ticketId:StopMatchmaking' :: StopMatchmaking -> Text
ticketId} -> Text
ticketId) (\s :: StopMatchmaking
s@StopMatchmaking' {} Text
a -> StopMatchmaking
s {$sel:ticketId:StopMatchmaking' :: Text
ticketId = Text
a} :: StopMatchmaking)
instance Core.AWSRequest StopMatchmaking where
type
AWSResponse StopMatchmaking =
StopMatchmakingResponse
request :: StopMatchmaking -> Request StopMatchmaking
request = Service -> StopMatchmaking -> Request StopMatchmaking
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopMatchmaking
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopMatchmaking)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse StopMatchmaking))
-> Logger
-> Service
-> Proxy StopMatchmaking
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopMatchmaking)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> StopMatchmakingResponse
StopMatchmakingResponse'
(Int -> StopMatchmakingResponse)
-> Either String Int -> Either String StopMatchmakingResponse
forall (f :: * -> *) a b. Functor 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 StopMatchmaking
instance Prelude.NFData StopMatchmaking
instance Core.ToHeaders StopMatchmaking where
toHeaders :: StopMatchmaking -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopMatchmaking -> 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.StopMatchmaking" :: 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 StopMatchmaking where
toJSON :: StopMatchmaking -> Value
toJSON StopMatchmaking' {Text
ticketId :: Text
$sel:ticketId:StopMatchmaking' :: StopMatchmaking -> 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
"TicketId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ticketId)]
)
instance Core.ToPath StopMatchmaking where
toPath :: StopMatchmaking -> ByteString
toPath = ByteString -> StopMatchmaking -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopMatchmaking where
toQuery :: StopMatchmaking -> QueryString
toQuery = QueryString -> StopMatchmaking -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopMatchmakingResponse = StopMatchmakingResponse'
{
StopMatchmakingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopMatchmakingResponse -> StopMatchmakingResponse -> Bool
(StopMatchmakingResponse -> StopMatchmakingResponse -> Bool)
-> (StopMatchmakingResponse -> StopMatchmakingResponse -> Bool)
-> Eq StopMatchmakingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopMatchmakingResponse -> StopMatchmakingResponse -> Bool
$c/= :: StopMatchmakingResponse -> StopMatchmakingResponse -> Bool
== :: StopMatchmakingResponse -> StopMatchmakingResponse -> Bool
$c== :: StopMatchmakingResponse -> StopMatchmakingResponse -> Bool
Prelude.Eq, ReadPrec [StopMatchmakingResponse]
ReadPrec StopMatchmakingResponse
Int -> ReadS StopMatchmakingResponse
ReadS [StopMatchmakingResponse]
(Int -> ReadS StopMatchmakingResponse)
-> ReadS [StopMatchmakingResponse]
-> ReadPrec StopMatchmakingResponse
-> ReadPrec [StopMatchmakingResponse]
-> Read StopMatchmakingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopMatchmakingResponse]
$creadListPrec :: ReadPrec [StopMatchmakingResponse]
readPrec :: ReadPrec StopMatchmakingResponse
$creadPrec :: ReadPrec StopMatchmakingResponse
readList :: ReadS [StopMatchmakingResponse]
$creadList :: ReadS [StopMatchmakingResponse]
readsPrec :: Int -> ReadS StopMatchmakingResponse
$creadsPrec :: Int -> ReadS StopMatchmakingResponse
Prelude.Read, Int -> StopMatchmakingResponse -> ShowS
[StopMatchmakingResponse] -> ShowS
StopMatchmakingResponse -> String
(Int -> StopMatchmakingResponse -> ShowS)
-> (StopMatchmakingResponse -> String)
-> ([StopMatchmakingResponse] -> ShowS)
-> Show StopMatchmakingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopMatchmakingResponse] -> ShowS
$cshowList :: [StopMatchmakingResponse] -> ShowS
show :: StopMatchmakingResponse -> String
$cshow :: StopMatchmakingResponse -> String
showsPrec :: Int -> StopMatchmakingResponse -> ShowS
$cshowsPrec :: Int -> StopMatchmakingResponse -> ShowS
Prelude.Show, (forall x.
StopMatchmakingResponse -> Rep StopMatchmakingResponse x)
-> (forall x.
Rep StopMatchmakingResponse x -> StopMatchmakingResponse)
-> Generic StopMatchmakingResponse
forall x. Rep StopMatchmakingResponse x -> StopMatchmakingResponse
forall x. StopMatchmakingResponse -> Rep StopMatchmakingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopMatchmakingResponse x -> StopMatchmakingResponse
$cfrom :: forall x. StopMatchmakingResponse -> Rep StopMatchmakingResponse x
Prelude.Generic)
newStopMatchmakingResponse ::
Prelude.Int ->
StopMatchmakingResponse
newStopMatchmakingResponse :: Int -> StopMatchmakingResponse
newStopMatchmakingResponse Int
pHttpStatus_ =
StopMatchmakingResponse' :: Int -> StopMatchmakingResponse
StopMatchmakingResponse' {$sel:httpStatus:StopMatchmakingResponse' :: Int
httpStatus = Int
pHttpStatus_}
stopMatchmakingResponse_httpStatus :: Lens.Lens' StopMatchmakingResponse Prelude.Int
stopMatchmakingResponse_httpStatus :: (Int -> f Int)
-> StopMatchmakingResponse -> f StopMatchmakingResponse
stopMatchmakingResponse_httpStatus = (StopMatchmakingResponse -> Int)
-> (StopMatchmakingResponse -> Int -> StopMatchmakingResponse)
-> Lens StopMatchmakingResponse StopMatchmakingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopMatchmakingResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopMatchmakingResponse' :: StopMatchmakingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopMatchmakingResponse
s@StopMatchmakingResponse' {} Int
a -> StopMatchmakingResponse
s {$sel:httpStatus:StopMatchmakingResponse' :: Int
httpStatus = Int
a} :: StopMatchmakingResponse)
instance Prelude.NFData StopMatchmakingResponse