{-# 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.AutoScaling.DeleteNotificationConfiguration
-- 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 the specified notification.
module Amazonka.AutoScaling.DeleteNotificationConfiguration
  ( -- * Creating a Request
    DeleteNotificationConfiguration (..),
    newDeleteNotificationConfiguration,

    -- * Request Lenses
    deleteNotificationConfiguration_autoScalingGroupName,
    deleteNotificationConfiguration_topicARN,

    -- * Destructuring the Response
    DeleteNotificationConfigurationResponse (..),
    newDeleteNotificationConfigurationResponse,
  )
where

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

-- | /See:/ 'newDeleteNotificationConfiguration' smart constructor.
data DeleteNotificationConfiguration = DeleteNotificationConfiguration'
  { -- | The name of the Auto Scaling group.
    DeleteNotificationConfiguration -> Text
autoScalingGroupName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Amazon Simple Notification Service
    -- (Amazon SNS) topic.
    DeleteNotificationConfiguration -> Text
topicARN :: Prelude.Text
  }
  deriving (DeleteNotificationConfiguration
-> DeleteNotificationConfiguration -> Bool
(DeleteNotificationConfiguration
 -> DeleteNotificationConfiguration -> Bool)
-> (DeleteNotificationConfiguration
    -> DeleteNotificationConfiguration -> Bool)
-> Eq DeleteNotificationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteNotificationConfiguration
-> DeleteNotificationConfiguration -> Bool
$c/= :: DeleteNotificationConfiguration
-> DeleteNotificationConfiguration -> Bool
== :: DeleteNotificationConfiguration
-> DeleteNotificationConfiguration -> Bool
$c== :: DeleteNotificationConfiguration
-> DeleteNotificationConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteNotificationConfiguration]
ReadPrec DeleteNotificationConfiguration
Int -> ReadS DeleteNotificationConfiguration
ReadS [DeleteNotificationConfiguration]
(Int -> ReadS DeleteNotificationConfiguration)
-> ReadS [DeleteNotificationConfiguration]
-> ReadPrec DeleteNotificationConfiguration
-> ReadPrec [DeleteNotificationConfiguration]
-> Read DeleteNotificationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteNotificationConfiguration]
$creadListPrec :: ReadPrec [DeleteNotificationConfiguration]
readPrec :: ReadPrec DeleteNotificationConfiguration
$creadPrec :: ReadPrec DeleteNotificationConfiguration
readList :: ReadS [DeleteNotificationConfiguration]
$creadList :: ReadS [DeleteNotificationConfiguration]
readsPrec :: Int -> ReadS DeleteNotificationConfiguration
$creadsPrec :: Int -> ReadS DeleteNotificationConfiguration
Prelude.Read, Int -> DeleteNotificationConfiguration -> ShowS
[DeleteNotificationConfiguration] -> ShowS
DeleteNotificationConfiguration -> String
(Int -> DeleteNotificationConfiguration -> ShowS)
-> (DeleteNotificationConfiguration -> String)
-> ([DeleteNotificationConfiguration] -> ShowS)
-> Show DeleteNotificationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteNotificationConfiguration] -> ShowS
$cshowList :: [DeleteNotificationConfiguration] -> ShowS
show :: DeleteNotificationConfiguration -> String
$cshow :: DeleteNotificationConfiguration -> String
showsPrec :: Int -> DeleteNotificationConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteNotificationConfiguration -> ShowS
Prelude.Show, (forall x.
 DeleteNotificationConfiguration
 -> Rep DeleteNotificationConfiguration x)
-> (forall x.
    Rep DeleteNotificationConfiguration x
    -> DeleteNotificationConfiguration)
-> Generic DeleteNotificationConfiguration
forall x.
Rep DeleteNotificationConfiguration x
-> DeleteNotificationConfiguration
forall x.
DeleteNotificationConfiguration
-> Rep DeleteNotificationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteNotificationConfiguration x
-> DeleteNotificationConfiguration
$cfrom :: forall x.
DeleteNotificationConfiguration
-> Rep DeleteNotificationConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteNotificationConfiguration' 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:
--
-- 'autoScalingGroupName', 'deleteNotificationConfiguration_autoScalingGroupName' - The name of the Auto Scaling group.
--
-- 'topicARN', 'deleteNotificationConfiguration_topicARN' - The Amazon Resource Name (ARN) of the Amazon Simple Notification Service
-- (Amazon SNS) topic.
newDeleteNotificationConfiguration ::
  -- | 'autoScalingGroupName'
  Prelude.Text ->
  -- | 'topicARN'
  Prelude.Text ->
  DeleteNotificationConfiguration
newDeleteNotificationConfiguration :: Text -> Text -> DeleteNotificationConfiguration
newDeleteNotificationConfiguration
  Text
pAutoScalingGroupName_
  Text
pTopicARN_ =
    DeleteNotificationConfiguration' :: Text -> Text -> DeleteNotificationConfiguration
DeleteNotificationConfiguration'
      { $sel:autoScalingGroupName:DeleteNotificationConfiguration' :: Text
autoScalingGroupName =
          Text
pAutoScalingGroupName_,
        $sel:topicARN:DeleteNotificationConfiguration' :: Text
topicARN = Text
pTopicARN_
      }

-- | The name of the Auto Scaling group.
deleteNotificationConfiguration_autoScalingGroupName :: Lens.Lens' DeleteNotificationConfiguration Prelude.Text
deleteNotificationConfiguration_autoScalingGroupName :: (Text -> f Text)
-> DeleteNotificationConfiguration
-> f DeleteNotificationConfiguration
deleteNotificationConfiguration_autoScalingGroupName = (DeleteNotificationConfiguration -> Text)
-> (DeleteNotificationConfiguration
    -> Text -> DeleteNotificationConfiguration)
-> Lens
     DeleteNotificationConfiguration
     DeleteNotificationConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNotificationConfiguration' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:DeleteNotificationConfiguration' :: DeleteNotificationConfiguration -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: DeleteNotificationConfiguration
s@DeleteNotificationConfiguration' {} Text
a -> DeleteNotificationConfiguration
s {$sel:autoScalingGroupName:DeleteNotificationConfiguration' :: Text
autoScalingGroupName = Text
a} :: DeleteNotificationConfiguration)

-- | The Amazon Resource Name (ARN) of the Amazon Simple Notification Service
-- (Amazon SNS) topic.
deleteNotificationConfiguration_topicARN :: Lens.Lens' DeleteNotificationConfiguration Prelude.Text
deleteNotificationConfiguration_topicARN :: (Text -> f Text)
-> DeleteNotificationConfiguration
-> f DeleteNotificationConfiguration
deleteNotificationConfiguration_topicARN = (DeleteNotificationConfiguration -> Text)
-> (DeleteNotificationConfiguration
    -> Text -> DeleteNotificationConfiguration)
-> Lens
     DeleteNotificationConfiguration
     DeleteNotificationConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNotificationConfiguration' {Text
topicARN :: Text
$sel:topicARN:DeleteNotificationConfiguration' :: DeleteNotificationConfiguration -> Text
topicARN} -> Text
topicARN) (\s :: DeleteNotificationConfiguration
s@DeleteNotificationConfiguration' {} Text
a -> DeleteNotificationConfiguration
s {$sel:topicARN:DeleteNotificationConfiguration' :: Text
topicARN = Text
a} :: DeleteNotificationConfiguration)

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

instance
  Prelude.Hashable
    DeleteNotificationConfiguration

instance
  Prelude.NFData
    DeleteNotificationConfiguration

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

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

instance Core.ToQuery DeleteNotificationConfiguration where
  toQuery :: DeleteNotificationConfiguration -> QueryString
toQuery DeleteNotificationConfiguration' {Text
topicARN :: Text
autoScalingGroupName :: Text
$sel:topicARN:DeleteNotificationConfiguration' :: DeleteNotificationConfiguration -> Text
$sel:autoScalingGroupName:DeleteNotificationConfiguration' :: DeleteNotificationConfiguration -> 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
"DeleteNotificationConfiguration" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName,
        ByteString
"TopicARN" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
topicARN
      ]

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

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

instance
  Prelude.NFData
    DeleteNotificationConfigurationResponse