{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GameLift.Types
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
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]
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
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. 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' {$sel:ticketId:StopMatchmaking' :: Text
ticketId = Text
pTicketId_}
stopMatchmaking_ticketId :: Lens.Lens' StopMatchmaking Prelude.Text
stopMatchmaking_ticketId :: Lens' StopMatchmaking Text
stopMatchmaking_ticketId = 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 :: (Service -> Service) -> StopMatchmaking -> Request StopMatchmaking
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StopMatchmaking
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopMatchmaking)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> StopMatchmakingResponse
StopMatchmakingResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable StopMatchmaking where
hashWithSalt :: Int -> StopMatchmaking -> Int
hashWithSalt Int
_salt StopMatchmaking' {Text
ticketId :: Text
$sel:ticketId:StopMatchmaking' :: StopMatchmaking -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ticketId
instance Prelude.NFData StopMatchmaking where
rnf :: StopMatchmaking -> ()
rnf StopMatchmaking' {Text
ticketId :: Text
$sel:ticketId:StopMatchmaking' :: StopMatchmaking -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
ticketId
instance Data.ToHeaders StopMatchmaking where
toHeaders :: StopMatchmaking -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"GameLift.StopMatchmaking" :: Prelude.ByteString),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StopMatchmaking where
toJSON :: StopMatchmaking -> Value
toJSON StopMatchmaking' {Text
ticketId :: Text
$sel:ticketId:StopMatchmaking' :: StopMatchmaking -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"TicketId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
ticketId)]
)
instance Data.ToPath StopMatchmaking where
toPath :: StopMatchmaking -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StopMatchmaking where
toQuery :: StopMatchmaking -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopMatchmakingResponse = StopMatchmakingResponse'
{
StopMatchmakingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopMatchmakingResponse -> StopMatchmakingResponse -> Bool
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]
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
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. 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' {$sel:httpStatus:StopMatchmakingResponse' :: Int
httpStatus = Int
pHttpStatus_}
stopMatchmakingResponse_httpStatus :: Lens.Lens' StopMatchmakingResponse Prelude.Int
stopMatchmakingResponse_httpStatus :: Lens' StopMatchmakingResponse Int
stopMatchmakingResponse_httpStatus = 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 where
rnf :: StopMatchmakingResponse -> ()
rnf StopMatchmakingResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopMatchmakingResponse' :: StopMatchmakingResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus