{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.GamesParks.DeleteGame
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a game.
module Amazonka.GamesParks.DeleteGame
  ( -- * Creating a Request
    DeleteGame (..),
    newDeleteGame,

    -- * Request Lenses
    deleteGame_gameName,

    -- * Destructuring the Response
    DeleteGameResponse (..),
    newDeleteGameResponse,

    -- * Response Lenses
    deleteGameResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GamesParks.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeleteGame' smart constructor.
data DeleteGame = DeleteGame'
  { -- | The name of the game to delete.
    DeleteGame -> Text
gameName :: Prelude.Text
  }
  deriving (DeleteGame -> DeleteGame -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGame -> DeleteGame -> Bool
$c/= :: DeleteGame -> DeleteGame -> Bool
== :: DeleteGame -> DeleteGame -> Bool
$c== :: DeleteGame -> DeleteGame -> Bool
Prelude.Eq, ReadPrec [DeleteGame]
ReadPrec DeleteGame
Int -> ReadS DeleteGame
ReadS [DeleteGame]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGame]
$creadListPrec :: ReadPrec [DeleteGame]
readPrec :: ReadPrec DeleteGame
$creadPrec :: ReadPrec DeleteGame
readList :: ReadS [DeleteGame]
$creadList :: ReadS [DeleteGame]
readsPrec :: Int -> ReadS DeleteGame
$creadsPrec :: Int -> ReadS DeleteGame
Prelude.Read, Int -> DeleteGame -> ShowS
[DeleteGame] -> ShowS
DeleteGame -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGame] -> ShowS
$cshowList :: [DeleteGame] -> ShowS
show :: DeleteGame -> String
$cshow :: DeleteGame -> String
showsPrec :: Int -> DeleteGame -> ShowS
$cshowsPrec :: Int -> DeleteGame -> ShowS
Prelude.Show, forall x. Rep DeleteGame x -> DeleteGame
forall x. DeleteGame -> Rep DeleteGame x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteGame x -> DeleteGame
$cfrom :: forall x. DeleteGame -> Rep DeleteGame x
Prelude.Generic)

-- |
-- Create a value of 'DeleteGame' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'gameName', 'deleteGame_gameName' - The name of the game to delete.
newDeleteGame ::
  -- | 'gameName'
  Prelude.Text ->
  DeleteGame
newDeleteGame :: Text -> DeleteGame
newDeleteGame Text
pGameName_ =
  DeleteGame' {$sel:gameName:DeleteGame' :: Text
gameName = Text
pGameName_}

-- | The name of the game to delete.
deleteGame_gameName :: Lens.Lens' DeleteGame Prelude.Text
deleteGame_gameName :: Lens' DeleteGame Text
deleteGame_gameName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGame' {Text
gameName :: Text
$sel:gameName:DeleteGame' :: DeleteGame -> Text
gameName} -> Text
gameName) (\s :: DeleteGame
s@DeleteGame' {} Text
a -> DeleteGame
s {$sel:gameName:DeleteGame' :: Text
gameName = Text
a} :: DeleteGame)

instance Core.AWSRequest DeleteGame where
  type AWSResponse DeleteGame = DeleteGameResponse
  request :: (Service -> Service) -> DeleteGame -> Request DeleteGame
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteGame
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteGame)))
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 -> DeleteGameResponse
DeleteGameResponse'
            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 DeleteGame where
  hashWithSalt :: Int -> DeleteGame -> Int
hashWithSalt Int
_salt DeleteGame' {Text
gameName :: Text
$sel:gameName:DeleteGame' :: DeleteGame -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gameName

instance Prelude.NFData DeleteGame where
  rnf :: DeleteGame -> ()
rnf DeleteGame' {Text
gameName :: Text
$sel:gameName:DeleteGame' :: DeleteGame -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
gameName

instance Data.ToHeaders DeleteGame where
  toHeaders :: DeleteGame -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath DeleteGame where
  toPath :: DeleteGame -> ByteString
toPath DeleteGame' {Text
gameName :: Text
$sel:gameName:DeleteGame' :: DeleteGame -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/game/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
gameName]

instance Data.ToQuery DeleteGame where
  toQuery :: DeleteGame -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDeleteGameResponse' smart constructor.
data DeleteGameResponse = DeleteGameResponse'
  { -- | The response's http status code.
    DeleteGameResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteGameResponse -> DeleteGameResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGameResponse -> DeleteGameResponse -> Bool
$c/= :: DeleteGameResponse -> DeleteGameResponse -> Bool
== :: DeleteGameResponse -> DeleteGameResponse -> Bool
$c== :: DeleteGameResponse -> DeleteGameResponse -> Bool
Prelude.Eq, ReadPrec [DeleteGameResponse]
ReadPrec DeleteGameResponse
Int -> ReadS DeleteGameResponse
ReadS [DeleteGameResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGameResponse]
$creadListPrec :: ReadPrec [DeleteGameResponse]
readPrec :: ReadPrec DeleteGameResponse
$creadPrec :: ReadPrec DeleteGameResponse
readList :: ReadS [DeleteGameResponse]
$creadList :: ReadS [DeleteGameResponse]
readsPrec :: Int -> ReadS DeleteGameResponse
$creadsPrec :: Int -> ReadS DeleteGameResponse
Prelude.Read, Int -> DeleteGameResponse -> ShowS
[DeleteGameResponse] -> ShowS
DeleteGameResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGameResponse] -> ShowS
$cshowList :: [DeleteGameResponse] -> ShowS
show :: DeleteGameResponse -> String
$cshow :: DeleteGameResponse -> String
showsPrec :: Int -> DeleteGameResponse -> ShowS
$cshowsPrec :: Int -> DeleteGameResponse -> ShowS
Prelude.Show, forall x. Rep DeleteGameResponse x -> DeleteGameResponse
forall x. DeleteGameResponse -> Rep DeleteGameResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteGameResponse x -> DeleteGameResponse
$cfrom :: forall x. DeleteGameResponse -> Rep DeleteGameResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteGameResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'deleteGameResponse_httpStatus' - The response's http status code.
newDeleteGameResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteGameResponse
newDeleteGameResponse :: Int -> DeleteGameResponse
newDeleteGameResponse Int
pHttpStatus_ =
  DeleteGameResponse' {$sel:httpStatus:DeleteGameResponse' :: Int
httpStatus = Int
pHttpStatus_}

-- | The response's http status code.
deleteGameResponse_httpStatus :: Lens.Lens' DeleteGameResponse Prelude.Int
deleteGameResponse_httpStatus :: Lens' DeleteGameResponse Int
deleteGameResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGameResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteGameResponse' :: DeleteGameResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteGameResponse
s@DeleteGameResponse' {} Int
a -> DeleteGameResponse
s {$sel:httpStatus:DeleteGameResponse' :: Int
httpStatus = Int
a} :: DeleteGameResponse)

instance Prelude.NFData DeleteGameResponse where
  rnf :: DeleteGameResponse -> ()
rnf DeleteGameResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteGameResponse' :: DeleteGameResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus