{-# 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.Redshift.DeleteUsageLimit
-- 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 usage limit from a cluster.
module Amazonka.Redshift.DeleteUsageLimit
  ( -- * Creating a Request
    DeleteUsageLimit (..),
    newDeleteUsageLimit,

    -- * Request Lenses
    deleteUsageLimit_usageLimitId,

    -- * Destructuring the Response
    DeleteUsageLimitResponse (..),
    newDeleteUsageLimitResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

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

-- |
-- Create a value of 'DeleteUsageLimit' 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:
--
-- 'usageLimitId', 'deleteUsageLimit_usageLimitId' - The identifier of the usage limit to delete.
newDeleteUsageLimit ::
  -- | 'usageLimitId'
  Prelude.Text ->
  DeleteUsageLimit
newDeleteUsageLimit :: Text -> DeleteUsageLimit
newDeleteUsageLimit Text
pUsageLimitId_ =
  DeleteUsageLimit' :: Text -> DeleteUsageLimit
DeleteUsageLimit' {$sel:usageLimitId:DeleteUsageLimit' :: Text
usageLimitId = Text
pUsageLimitId_}

-- | The identifier of the usage limit to delete.
deleteUsageLimit_usageLimitId :: Lens.Lens' DeleteUsageLimit Prelude.Text
deleteUsageLimit_usageLimitId :: (Text -> f Text) -> DeleteUsageLimit -> f DeleteUsageLimit
deleteUsageLimit_usageLimitId = (DeleteUsageLimit -> Text)
-> (DeleteUsageLimit -> Text -> DeleteUsageLimit)
-> Lens DeleteUsageLimit DeleteUsageLimit Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUsageLimit' {Text
usageLimitId :: Text
$sel:usageLimitId:DeleteUsageLimit' :: DeleteUsageLimit -> Text
usageLimitId} -> Text
usageLimitId) (\s :: DeleteUsageLimit
s@DeleteUsageLimit' {} Text
a -> DeleteUsageLimit
s {$sel:usageLimitId:DeleteUsageLimit' :: Text
usageLimitId = Text
a} :: DeleteUsageLimit)

instance Core.AWSRequest DeleteUsageLimit where
  type
    AWSResponse DeleteUsageLimit =
      DeleteUsageLimitResponse
  request :: DeleteUsageLimit -> Request DeleteUsageLimit
request = Service -> DeleteUsageLimit -> Request DeleteUsageLimit
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteUsageLimit
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUsageLimit)))
response =
    AWSResponse DeleteUsageLimit
-> Logger
-> Service
-> Proxy DeleteUsageLimit
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUsageLimit)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteUsageLimit
DeleteUsageLimitResponse
DeleteUsageLimitResponse'

instance Prelude.Hashable DeleteUsageLimit

instance Prelude.NFData DeleteUsageLimit

instance Core.ToHeaders DeleteUsageLimit where
  toHeaders :: DeleteUsageLimit -> [Header]
toHeaders = [Header] -> DeleteUsageLimit -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery DeleteUsageLimit where
  toQuery :: DeleteUsageLimit -> QueryString
toQuery DeleteUsageLimit' {Text
usageLimitId :: Text
$sel:usageLimitId:DeleteUsageLimit' :: DeleteUsageLimit -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteUsageLimit" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"UsageLimitId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
usageLimitId
      ]

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

-- |
-- Create a value of 'DeleteUsageLimitResponse' 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.
newDeleteUsageLimitResponse ::
  DeleteUsageLimitResponse
newDeleteUsageLimitResponse :: DeleteUsageLimitResponse
newDeleteUsageLimitResponse =
  DeleteUsageLimitResponse
DeleteUsageLimitResponse'

instance Prelude.NFData DeleteUsageLimitResponse