{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 SNS topic.
    DeleteNotificationConfiguration -> Text
topicARN :: Prelude.Text
  }
  deriving (DeleteNotificationConfiguration
-> DeleteNotificationConfiguration -> Bool
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]
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
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.
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 SNS topic.
newDeleteNotificationConfiguration ::
  -- | 'autoScalingGroupName'
  Prelude.Text ->
  -- | 'topicARN'
  Prelude.Text ->
  DeleteNotificationConfiguration
newDeleteNotificationConfiguration :: Text -> Text -> DeleteNotificationConfiguration
newDeleteNotificationConfiguration
  Text
pAutoScalingGroupName_
  Text
pTopicARN_ =
    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 :: Lens' DeleteNotificationConfiguration Text
deleteNotificationConfiguration_autoScalingGroupName = 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 SNS topic.
deleteNotificationConfiguration_topicARN :: Lens.Lens' DeleteNotificationConfiguration Prelude.Text
deleteNotificationConfiguration_topicARN :: Lens' DeleteNotificationConfiguration Text
deleteNotificationConfiguration_topicARN = 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 :: (Service -> Service)
-> DeleteNotificationConfiguration
-> Request DeleteNotificationConfiguration
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteNotificationConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteNotificationConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteNotificationConfigurationResponse
DeleteNotificationConfigurationResponse'

instance
  Prelude.Hashable
    DeleteNotificationConfiguration
  where
  hashWithSalt :: Int -> DeleteNotificationConfiguration -> Int
hashWithSalt
    Int
_salt
    DeleteNotificationConfiguration' {Text
topicARN :: Text
autoScalingGroupName :: Text
$sel:topicARN:DeleteNotificationConfiguration' :: DeleteNotificationConfiguration -> Text
$sel:autoScalingGroupName:DeleteNotificationConfiguration' :: DeleteNotificationConfiguration -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
autoScalingGroupName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
topicARN

instance
  Prelude.NFData
    DeleteNotificationConfiguration
  where
  rnf :: DeleteNotificationConfiguration -> ()
rnf DeleteNotificationConfiguration' {Text
topicARN :: Text
autoScalingGroupName :: Text
$sel:topicARN:DeleteNotificationConfiguration' :: DeleteNotificationConfiguration -> Text
$sel:autoScalingGroupName:DeleteNotificationConfiguration' :: DeleteNotificationConfiguration -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
autoScalingGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
topicARN

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

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

instance Data.ToQuery DeleteNotificationConfiguration where
  toQuery :: DeleteNotificationConfiguration -> QueryString
toQuery DeleteNotificationConfiguration' {Text
topicARN :: Text
autoScalingGroupName :: Text
$sel:topicARN:DeleteNotificationConfiguration' :: DeleteNotificationConfiguration -> Text
$sel:autoScalingGroupName:DeleteNotificationConfiguration' :: DeleteNotificationConfiguration -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DeleteNotificationConfiguration" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"AutoScalingGroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
autoScalingGroupName,
        ByteString
"TopicARN" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
topicARN
      ]

-- | /See:/ 'newDeleteNotificationConfigurationResponse' smart constructor.
data DeleteNotificationConfigurationResponse = DeleteNotificationConfigurationResponse'
  {
  }
  deriving (DeleteNotificationConfigurationResponse
-> DeleteNotificationConfigurationResponse -> Bool
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]
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
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.
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
  where
  rnf :: DeleteNotificationConfigurationResponse -> ()
rnf DeleteNotificationConfigurationResponse
_ = ()