{-# 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.RDS.DeleteOptionGroup
-- 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 an existing option group.
module Amazonka.RDS.DeleteOptionGroup
  ( -- * Creating a Request
    DeleteOptionGroup (..),
    newDeleteOptionGroup,

    -- * Request Lenses
    deleteOptionGroup_optionGroupName,

    -- * Destructuring the Response
    DeleteOptionGroupResponse (..),
    newDeleteOptionGroupResponse,
  )
where

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

-- |
--
-- /See:/ 'newDeleteOptionGroup' smart constructor.
data DeleteOptionGroup = DeleteOptionGroup'
  { -- | The name of the option group to be deleted.
    --
    -- You can\'t delete default option groups.
    DeleteOptionGroup -> Text
optionGroupName :: Prelude.Text
  }
  deriving (DeleteOptionGroup -> DeleteOptionGroup -> Bool
(DeleteOptionGroup -> DeleteOptionGroup -> Bool)
-> (DeleteOptionGroup -> DeleteOptionGroup -> Bool)
-> Eq DeleteOptionGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteOptionGroup -> DeleteOptionGroup -> Bool
$c/= :: DeleteOptionGroup -> DeleteOptionGroup -> Bool
== :: DeleteOptionGroup -> DeleteOptionGroup -> Bool
$c== :: DeleteOptionGroup -> DeleteOptionGroup -> Bool
Prelude.Eq, ReadPrec [DeleteOptionGroup]
ReadPrec DeleteOptionGroup
Int -> ReadS DeleteOptionGroup
ReadS [DeleteOptionGroup]
(Int -> ReadS DeleteOptionGroup)
-> ReadS [DeleteOptionGroup]
-> ReadPrec DeleteOptionGroup
-> ReadPrec [DeleteOptionGroup]
-> Read DeleteOptionGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteOptionGroup]
$creadListPrec :: ReadPrec [DeleteOptionGroup]
readPrec :: ReadPrec DeleteOptionGroup
$creadPrec :: ReadPrec DeleteOptionGroup
readList :: ReadS [DeleteOptionGroup]
$creadList :: ReadS [DeleteOptionGroup]
readsPrec :: Int -> ReadS DeleteOptionGroup
$creadsPrec :: Int -> ReadS DeleteOptionGroup
Prelude.Read, Int -> DeleteOptionGroup -> ShowS
[DeleteOptionGroup] -> ShowS
DeleteOptionGroup -> String
(Int -> DeleteOptionGroup -> ShowS)
-> (DeleteOptionGroup -> String)
-> ([DeleteOptionGroup] -> ShowS)
-> Show DeleteOptionGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteOptionGroup] -> ShowS
$cshowList :: [DeleteOptionGroup] -> ShowS
show :: DeleteOptionGroup -> String
$cshow :: DeleteOptionGroup -> String
showsPrec :: Int -> DeleteOptionGroup -> ShowS
$cshowsPrec :: Int -> DeleteOptionGroup -> ShowS
Prelude.Show, (forall x. DeleteOptionGroup -> Rep DeleteOptionGroup x)
-> (forall x. Rep DeleteOptionGroup x -> DeleteOptionGroup)
-> Generic DeleteOptionGroup
forall x. Rep DeleteOptionGroup x -> DeleteOptionGroup
forall x. DeleteOptionGroup -> Rep DeleteOptionGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteOptionGroup x -> DeleteOptionGroup
$cfrom :: forall x. DeleteOptionGroup -> Rep DeleteOptionGroup x
Prelude.Generic)

-- |
-- Create a value of 'DeleteOptionGroup' 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:
--
-- 'optionGroupName', 'deleteOptionGroup_optionGroupName' - The name of the option group to be deleted.
--
-- You can\'t delete default option groups.
newDeleteOptionGroup ::
  -- | 'optionGroupName'
  Prelude.Text ->
  DeleteOptionGroup
newDeleteOptionGroup :: Text -> DeleteOptionGroup
newDeleteOptionGroup Text
pOptionGroupName_ =
  DeleteOptionGroup' :: Text -> DeleteOptionGroup
DeleteOptionGroup'
    { $sel:optionGroupName:DeleteOptionGroup' :: Text
optionGroupName =
        Text
pOptionGroupName_
    }

-- | The name of the option group to be deleted.
--
-- You can\'t delete default option groups.
deleteOptionGroup_optionGroupName :: Lens.Lens' DeleteOptionGroup Prelude.Text
deleteOptionGroup_optionGroupName :: (Text -> f Text) -> DeleteOptionGroup -> f DeleteOptionGroup
deleteOptionGroup_optionGroupName = (DeleteOptionGroup -> Text)
-> (DeleteOptionGroup -> Text -> DeleteOptionGroup)
-> Lens DeleteOptionGroup DeleteOptionGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOptionGroup' {Text
optionGroupName :: Text
$sel:optionGroupName:DeleteOptionGroup' :: DeleteOptionGroup -> Text
optionGroupName} -> Text
optionGroupName) (\s :: DeleteOptionGroup
s@DeleteOptionGroup' {} Text
a -> DeleteOptionGroup
s {$sel:optionGroupName:DeleteOptionGroup' :: Text
optionGroupName = Text
a} :: DeleteOptionGroup)

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

instance Prelude.Hashable DeleteOptionGroup

instance Prelude.NFData DeleteOptionGroup

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

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

instance Core.ToQuery DeleteOptionGroup where
  toQuery :: DeleteOptionGroup -> QueryString
toQuery DeleteOptionGroup' {Text
optionGroupName :: Text
$sel:optionGroupName:DeleteOptionGroup' :: DeleteOptionGroup -> 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
"DeleteOptionGroup" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"OptionGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
optionGroupName
      ]

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

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

instance Prelude.NFData DeleteOptionGroupResponse