{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a game session queue. Once a queue is successfully deleted,
-- unfulfilled StartGameSessionPlacement requests that reference the queue
-- will fail. To delete a queue, specify the queue name.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-intro.html Using Multi-Region Queues>
--
-- __Related actions__
--
-- CreateGameSessionQueue | DescribeGameSessionQueues |
-- UpdateGameSessionQueue | DeleteGameSessionQueue |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
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 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

-- | Represents the input for a request operation.
--
-- /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
(DeleteGameSessionQueue -> DeleteGameSessionQueue -> Bool)
-> (DeleteGameSessionQueue -> DeleteGameSessionQueue -> Bool)
-> Eq DeleteGameSessionQueue
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]
(Int -> ReadS DeleteGameSessionQueue)
-> ReadS [DeleteGameSessionQueue]
-> ReadPrec DeleteGameSessionQueue
-> ReadPrec [DeleteGameSessionQueue]
-> Read 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
(Int -> DeleteGameSessionQueue -> ShowS)
-> (DeleteGameSessionQueue -> String)
-> ([DeleteGameSessionQueue] -> ShowS)
-> Show DeleteGameSessionQueue
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. DeleteGameSessionQueue -> Rep DeleteGameSessionQueue x)
-> (forall x.
    Rep DeleteGameSessionQueue x -> DeleteGameSessionQueue)
-> Generic DeleteGameSessionQueue
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' :: Text -> DeleteGameSessionQueue
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 :: (Text -> f Text)
-> DeleteGameSessionQueue -> f DeleteGameSessionQueue
deleteGameSessionQueue_name = (DeleteGameSessionQueue -> Text)
-> (DeleteGameSessionQueue -> Text -> DeleteGameSessionQueue)
-> Lens DeleteGameSessionQueue DeleteGameSessionQueue Text Text
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 :: DeleteGameSessionQueue -> Request DeleteGameSessionQueue
request = Service -> DeleteGameSessionQueue -> Request DeleteGameSessionQueue
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteGameSessionQueue
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteGameSessionQueue)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteGameSessionQueue))
-> Logger
-> Service
-> Proxy DeleteGameSessionQueue
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteGameSessionQueue)))
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 -> DeleteGameSessionQueueResponse
DeleteGameSessionQueueResponse'
            (Int -> DeleteGameSessionQueueResponse)
-> Either String Int
-> Either String DeleteGameSessionQueueResponse
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 DeleteGameSessionQueue

instance Prelude.NFData DeleteGameSessionQueue

instance Core.ToHeaders DeleteGameSessionQueue where
  toHeaders :: DeleteGameSessionQueue -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteGameSessionQueue -> 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.DeleteGameSessionQueue" ::
                          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 DeleteGameSessionQueue where
  toJSON :: DeleteGameSessionQueue -> Value
toJSON DeleteGameSessionQueue' {Text
name :: Text
$sel:name:DeleteGameSessionQueue' :: DeleteGameSessionQueue -> 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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
      )

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

instance Core.ToQuery DeleteGameSessionQueue where
  toQuery :: DeleteGameSessionQueue -> QueryString
toQuery = QueryString -> DeleteGameSessionQueue -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DeleteGameSessionQueueResponse
 -> DeleteGameSessionQueueResponse -> Bool)
-> (DeleteGameSessionQueueResponse
    -> DeleteGameSessionQueueResponse -> Bool)
-> Eq DeleteGameSessionQueueResponse
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]
(Int -> ReadS DeleteGameSessionQueueResponse)
-> ReadS [DeleteGameSessionQueueResponse]
-> ReadPrec DeleteGameSessionQueueResponse
-> ReadPrec [DeleteGameSessionQueueResponse]
-> Read 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
(Int -> DeleteGameSessionQueueResponse -> ShowS)
-> (DeleteGameSessionQueueResponse -> String)
-> ([DeleteGameSessionQueueResponse] -> ShowS)
-> Show DeleteGameSessionQueueResponse
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.
 DeleteGameSessionQueueResponse
 -> Rep DeleteGameSessionQueueResponse x)
-> (forall x.
    Rep DeleteGameSessionQueueResponse x
    -> DeleteGameSessionQueueResponse)
-> Generic DeleteGameSessionQueueResponse
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' :: Int -> DeleteGameSessionQueueResponse
DeleteGameSessionQueueResponse'
    { $sel:httpStatus:DeleteGameSessionQueueResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteGameSessionQueueResponse_httpStatus :: Lens.Lens' DeleteGameSessionQueueResponse Prelude.Int
deleteGameSessionQueueResponse_httpStatus :: (Int -> f Int)
-> DeleteGameSessionQueueResponse
-> f DeleteGameSessionQueueResponse
deleteGameSessionQueueResponse_httpStatus = (DeleteGameSessionQueueResponse -> Int)
-> (DeleteGameSessionQueueResponse
    -> Int -> DeleteGameSessionQueueResponse)
-> Lens
     DeleteGameSessionQueueResponse
     DeleteGameSessionQueueResponse
     Int
     Int
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