{-# 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.DeleteScript
(
DeleteScript (..),
newDeleteScript,
deleteScript_scriptId,
DeleteScriptResponse (..),
newDeleteScriptResponse,
)
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 DeleteScript = DeleteScript'
{
DeleteScript -> Text
scriptId :: Prelude.Text
}
deriving (DeleteScript -> DeleteScript -> Bool
(DeleteScript -> DeleteScript -> Bool)
-> (DeleteScript -> DeleteScript -> Bool) -> Eq DeleteScript
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteScript -> DeleteScript -> Bool
$c/= :: DeleteScript -> DeleteScript -> Bool
== :: DeleteScript -> DeleteScript -> Bool
$c== :: DeleteScript -> DeleteScript -> Bool
Prelude.Eq, ReadPrec [DeleteScript]
ReadPrec DeleteScript
Int -> ReadS DeleteScript
ReadS [DeleteScript]
(Int -> ReadS DeleteScript)
-> ReadS [DeleteScript]
-> ReadPrec DeleteScript
-> ReadPrec [DeleteScript]
-> Read DeleteScript
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteScript]
$creadListPrec :: ReadPrec [DeleteScript]
readPrec :: ReadPrec DeleteScript
$creadPrec :: ReadPrec DeleteScript
readList :: ReadS [DeleteScript]
$creadList :: ReadS [DeleteScript]
readsPrec :: Int -> ReadS DeleteScript
$creadsPrec :: Int -> ReadS DeleteScript
Prelude.Read, Int -> DeleteScript -> ShowS
[DeleteScript] -> ShowS
DeleteScript -> String
(Int -> DeleteScript -> ShowS)
-> (DeleteScript -> String)
-> ([DeleteScript] -> ShowS)
-> Show DeleteScript
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteScript] -> ShowS
$cshowList :: [DeleteScript] -> ShowS
show :: DeleteScript -> String
$cshow :: DeleteScript -> String
showsPrec :: Int -> DeleteScript -> ShowS
$cshowsPrec :: Int -> DeleteScript -> ShowS
Prelude.Show, (forall x. DeleteScript -> Rep DeleteScript x)
-> (forall x. Rep DeleteScript x -> DeleteScript)
-> Generic DeleteScript
forall x. Rep DeleteScript x -> DeleteScript
forall x. DeleteScript -> Rep DeleteScript x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteScript x -> DeleteScript
$cfrom :: forall x. DeleteScript -> Rep DeleteScript x
Prelude.Generic)
newDeleteScript ::
Prelude.Text ->
DeleteScript
newDeleteScript :: Text -> DeleteScript
newDeleteScript Text
pScriptId_ =
DeleteScript' :: Text -> DeleteScript
DeleteScript' {$sel:scriptId:DeleteScript' :: Text
scriptId = Text
pScriptId_}
deleteScript_scriptId :: Lens.Lens' DeleteScript Prelude.Text
deleteScript_scriptId :: (Text -> f Text) -> DeleteScript -> f DeleteScript
deleteScript_scriptId = (DeleteScript -> Text)
-> (DeleteScript -> Text -> DeleteScript)
-> Lens DeleteScript DeleteScript Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteScript' {Text
scriptId :: Text
$sel:scriptId:DeleteScript' :: DeleteScript -> Text
scriptId} -> Text
scriptId) (\s :: DeleteScript
s@DeleteScript' {} Text
a -> DeleteScript
s {$sel:scriptId:DeleteScript' :: Text
scriptId = Text
a} :: DeleteScript)
instance Core.AWSRequest DeleteScript where
type AWSResponse DeleteScript = DeleteScriptResponse
request :: DeleteScript -> Request DeleteScript
request = Service -> DeleteScript -> Request DeleteScript
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteScript
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteScript)))
response = AWSResponse DeleteScript
-> Logger
-> Service
-> Proxy DeleteScript
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteScript)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteScript
DeleteScriptResponse
DeleteScriptResponse'
instance Prelude.Hashable DeleteScript
instance Prelude.NFData DeleteScript
instance Core.ToHeaders DeleteScript where
toHeaders :: DeleteScript -> [Header]
toHeaders =
[Header] -> DeleteScript -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# (ByteString
"GameLift.DeleteScript" :: Prelude.ByteString),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteScript where
toJSON :: DeleteScript -> Value
toJSON DeleteScript' {Text
scriptId :: Text
$sel:scriptId:DeleteScript' :: DeleteScript -> 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
"ScriptId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
scriptId)]
)
instance Core.ToPath DeleteScript where
toPath :: DeleteScript -> ByteString
toPath = ByteString -> DeleteScript -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteScript where
toQuery :: DeleteScript -> QueryString
toQuery = QueryString -> DeleteScript -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteScriptResponse = DeleteScriptResponse'
{
}
deriving (DeleteScriptResponse -> DeleteScriptResponse -> Bool
(DeleteScriptResponse -> DeleteScriptResponse -> Bool)
-> (DeleteScriptResponse -> DeleteScriptResponse -> Bool)
-> Eq DeleteScriptResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteScriptResponse -> DeleteScriptResponse -> Bool
$c/= :: DeleteScriptResponse -> DeleteScriptResponse -> Bool
== :: DeleteScriptResponse -> DeleteScriptResponse -> Bool
$c== :: DeleteScriptResponse -> DeleteScriptResponse -> Bool
Prelude.Eq, ReadPrec [DeleteScriptResponse]
ReadPrec DeleteScriptResponse
Int -> ReadS DeleteScriptResponse
ReadS [DeleteScriptResponse]
(Int -> ReadS DeleteScriptResponse)
-> ReadS [DeleteScriptResponse]
-> ReadPrec DeleteScriptResponse
-> ReadPrec [DeleteScriptResponse]
-> Read DeleteScriptResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteScriptResponse]
$creadListPrec :: ReadPrec [DeleteScriptResponse]
readPrec :: ReadPrec DeleteScriptResponse
$creadPrec :: ReadPrec DeleteScriptResponse
readList :: ReadS [DeleteScriptResponse]
$creadList :: ReadS [DeleteScriptResponse]
readsPrec :: Int -> ReadS DeleteScriptResponse
$creadsPrec :: Int -> ReadS DeleteScriptResponse
Prelude.Read, Int -> DeleteScriptResponse -> ShowS
[DeleteScriptResponse] -> ShowS
DeleteScriptResponse -> String
(Int -> DeleteScriptResponse -> ShowS)
-> (DeleteScriptResponse -> String)
-> ([DeleteScriptResponse] -> ShowS)
-> Show DeleteScriptResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteScriptResponse] -> ShowS
$cshowList :: [DeleteScriptResponse] -> ShowS
show :: DeleteScriptResponse -> String
$cshow :: DeleteScriptResponse -> String
showsPrec :: Int -> DeleteScriptResponse -> ShowS
$cshowsPrec :: Int -> DeleteScriptResponse -> ShowS
Prelude.Show, (forall x. DeleteScriptResponse -> Rep DeleteScriptResponse x)
-> (forall x. Rep DeleteScriptResponse x -> DeleteScriptResponse)
-> Generic DeleteScriptResponse
forall x. Rep DeleteScriptResponse x -> DeleteScriptResponse
forall x. DeleteScriptResponse -> Rep DeleteScriptResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteScriptResponse x -> DeleteScriptResponse
$cfrom :: forall x. DeleteScriptResponse -> Rep DeleteScriptResponse x
Prelude.Generic)
newDeleteScriptResponse ::
DeleteScriptResponse
newDeleteScriptResponse :: DeleteScriptResponse
newDeleteScriptResponse = DeleteScriptResponse
DeleteScriptResponse'
instance Prelude.NFData DeleteScriptResponse