{-# 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.GameLift.DeleteGameSessionQueue
-- 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 session queue. Once a queue is successfully deleted,
-- unfulfilled
-- <https://docs.aws.amazon.com/gamelift/latest/apireference/API_StartGameSessionPlacement.html StartGameSessionPlacement>
-- requests that reference the queue will fail. To delete a queue, specify
-- the queue name.
module Amazonka.GameLift.DeleteGameSessionQueue
  ( -- * Creating a Request
    DeleteGameSessionQueue (..),
    newDeleteGameSessionQueue,

    -- * Request Lenses
    deleteGameSessionQueue_name,

    -- * Destructuring the Response
    DeleteGameSessionQueueResponse (..),
    newDeleteGameSessionQueueResponse,

    -- * Response Lenses
    deleteGameSessionQueueResponse_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

-- | /See:/ 'newDeleteGameSessionQueue' smart constructor.
data DeleteGameSessionQueue = DeleteGameSessionQueue'
  { -- | A descriptive label that is associated with game session queue. Queue
    -- names must be unique within each Region. You can use either the queue ID
    -- or ARN value.
    DeleteGameSessionQueue -> Text
name :: Prelude.Text
  }
  deriving (DeleteGameSessionQueue -> DeleteGameSessionQueue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGameSessionQueue -> DeleteGameSessionQueue -> Bool
$c/= :: DeleteGameSessionQueue -> DeleteGameSessionQueue -> Bool
== :: DeleteGameSessionQueue -> DeleteGameSessionQueue -> Bool
$c== :: DeleteGameSessionQueue -> DeleteGameSessionQueue -> Bool
Prelude.Eq, ReadPrec [DeleteGameSessionQueue]
ReadPrec DeleteGameSessionQueue
Int -> ReadS DeleteGameSessionQueue
ReadS [DeleteGameSessionQueue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGameSessionQueue]
$creadListPrec :: ReadPrec [DeleteGameSessionQueue]
readPrec :: ReadPrec DeleteGameSessionQueue
$creadPrec :: ReadPrec DeleteGameSessionQueue
readList :: ReadS [DeleteGameSessionQueue]
$creadList :: ReadS [DeleteGameSessionQueue]
readsPrec :: Int -> ReadS DeleteGameSessionQueue
$creadsPrec :: Int -> ReadS DeleteGameSessionQueue
Prelude.Read, Int -> DeleteGameSessionQueue -> ShowS
[DeleteGameSessionQueue] -> ShowS
DeleteGameSessionQueue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGameSessionQueue] -> ShowS
$cshowList :: [DeleteGameSessionQueue] -> ShowS
show :: DeleteGameSessionQueue -> String
$cshow :: DeleteGameSessionQueue -> String
showsPrec :: Int -> DeleteGameSessionQueue -> ShowS
$cshowsPrec :: Int -> DeleteGameSessionQueue -> ShowS
Prelude.Show, forall x. Rep DeleteGameSessionQueue x -> DeleteGameSessionQueue
forall x. DeleteGameSessionQueue -> Rep DeleteGameSessionQueue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteGameSessionQueue x -> DeleteGameSessionQueue
$cfrom :: forall x. DeleteGameSessionQueue -> Rep DeleteGameSessionQueue x
Prelude.Generic)

-- |
-- Create a value of 'DeleteGameSessionQueue' 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:
--
-- 'name', 'deleteGameSessionQueue_name' - A descriptive label that is associated with game session queue. Queue
-- names must be unique within each Region. You can use either the queue ID
-- or ARN value.
newDeleteGameSessionQueue ::
  -- | 'name'
  Prelude.Text ->
  DeleteGameSessionQueue
newDeleteGameSessionQueue :: Text -> DeleteGameSessionQueue
newDeleteGameSessionQueue Text
pName_ =
  DeleteGameSessionQueue' {$sel:name:DeleteGameSessionQueue' :: Text
name = Text
pName_}

-- | A descriptive label that is associated with game session queue. Queue
-- names must be unique within each Region. You can use either the queue ID
-- or ARN value.
deleteGameSessionQueue_name :: Lens.Lens' DeleteGameSessionQueue Prelude.Text
deleteGameSessionQueue_name :: Lens' DeleteGameSessionQueue Text
deleteGameSessionQueue_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGameSessionQueue' {Text
name :: Text
$sel:name:DeleteGameSessionQueue' :: DeleteGameSessionQueue -> Text
name} -> Text
name) (\s :: DeleteGameSessionQueue
s@DeleteGameSessionQueue' {} Text
a -> DeleteGameSessionQueue
s {$sel:name:DeleteGameSessionQueue' :: Text
name = Text
a} :: DeleteGameSessionQueue)

instance Core.AWSRequest DeleteGameSessionQueue where
  type
    AWSResponse DeleteGameSessionQueue =
      DeleteGameSessionQueueResponse
  request :: (Service -> Service)
-> DeleteGameSessionQueue -> Request DeleteGameSessionQueue
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 DeleteGameSessionQueue
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteGameSessionQueue)))
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 -> DeleteGameSessionQueueResponse
DeleteGameSessionQueueResponse'
            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 DeleteGameSessionQueue where
  hashWithSalt :: Int -> DeleteGameSessionQueue -> Int
hashWithSalt Int
_salt DeleteGameSessionQueue' {Text
name :: Text
$sel:name:DeleteGameSessionQueue' :: DeleteGameSessionQueue -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

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

instance Data.ToHeaders DeleteGameSessionQueue where
  toHeaders :: DeleteGameSessionQueue -> 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.DeleteGameSessionQueue" ::
                          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 DeleteGameSessionQueue where
  toJSON :: DeleteGameSessionQueue -> Value
toJSON DeleteGameSessionQueue' {Text
name :: Text
$sel:name:DeleteGameSessionQueue' :: DeleteGameSessionQueue -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)]
      )

instance Data.ToPath DeleteGameSessionQueue where
  toPath :: DeleteGameSessionQueue -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'DeleteGameSessionQueueResponse' 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', 'deleteGameSessionQueueResponse_httpStatus' - The response's http status code.
newDeleteGameSessionQueueResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteGameSessionQueueResponse
newDeleteGameSessionQueueResponse :: Int -> DeleteGameSessionQueueResponse
newDeleteGameSessionQueueResponse Int
pHttpStatus_ =
  DeleteGameSessionQueueResponse'
    { $sel:httpStatus:DeleteGameSessionQueueResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

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